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.
  • Constructor Details

    • MenuButton

      public MenuButton()
      Constructor.
  • Method Details

    • getItems

      public List<MenuItem> getItems()
      Returns the items.
    • setItems

      public void setItems(List<MenuItem> theItems)
      Sets the items.
    • addItem

      public void addItem(MenuItem anItem)
      Adds a new 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.
    • getPopupSize

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

      public void setPopupSize(Size aValue)
      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
    • setOwner

      public void setOwner(ViewOwner anOwner)
      Override to send to items.
      Overrides:
      setOwner in class ParentView
    • 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