Package snap.view

Class MenuButton

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable

public class MenuButton extends ButtonBase
Button subclass to show a menu when clicked.
  • Field Details

  • Constructor Details

    • MenuButton

      public MenuButton()
      Constructor.
  • Method Details

    • getMenuItems

      public MenuItem[] getMenuItems()
      Returns the menu items.
    • setMenuItems

      public void setMenuItems(MenuItem[] theItems)
      Sets the menu items.
    • addMenuItem

      public void addMenuItem(MenuItem anItem)
      Adds a menu item.
    • isShowArrow

      public boolean isShowArrow()
      Returns whether button should show arrow.
    • setShowArrow

      public void setShowArrow(boolean aValue)
      Sets whether button should show arrow.
    • getPopupPoint

      public Point getPopupPoint()
      Returns the popup point.
    • setPopupPoint

      public void setPopupPoint(Point aValue)
      Sets the popup point.
    • setPopupXY

      public void setPopupXY(double popupX, double popupY)
      Sets the popup point.
    • getPopupSize

      public Size getPopupSize()
      Returns the popup size.
    • setPopupSize

      public void setPopupSize(Size aValue)
      Sets the popup size.
    • setPopupSize

      public void setPopupSize(double aW, double aH)
      Sets the popup size.
    • getMenu

      public Menu getMenu()
      Returns the menu.
    • isMenuShowing

      public boolean isMenuShowing()
      Returns whether menu is showing.
    • showMenu

      public void showMenu()
      Shows the popup menu.
    • hideMenu

      public void hideMenu()
      Hides the menu.
    • processEvent

      protected void processEvent(ViewEvent anEvent)
      Handle events.
      Overrides:
      processEvent in class ButtonBase
    • getItemForName

      public MenuItem getItemForName(String aName)
      Returns the item for given name.
    • setOwner

      public void setOwner(ViewOwner anOwner)
      Override to send to items.
      Overrides:
      setOwner in class ParentView
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to support props for this class.
      Overrides:
      initProps in class ButtonBase
    • getPropValue

      public Object getPropValue(String aPropName)
      Override to support props for this class.
      Overrides:
      getPropValue in class ButtonBase
    • setPropValue

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue in class ButtonBase
    • toXMLView

      public XMLElement toXMLView(XMLArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLView in class ButtonBase
    • fromXMLView

      public void fromXMLView(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Overrides:
      fromXMLView in class ButtonBase
    • toXMLChildren

      protected void toXMLChildren(XMLArchiver anArchiver, XMLElement anElement)
      XML archival of children.
      Overrides:
      toXMLChildren in class ParentView
    • fromXMLChildren

      protected void fromXMLChildren(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival for shape children.
      Overrides:
      fromXMLChildren in class ParentView