Package snap.view

Class Menu

All Implemented Interfaces:
Cloneable, PropChange.DoChange, XMLArchiver.Archivable

public class Menu extends MenuItem
A MenuItem subclass to show child menu items.
  • Constructor Details

    • Menu

      public Menu()
      Constructor.
  • Method Details

    • isShowArrow

      public boolean isShowArrow()
      Returns whether menu is showing arrow graphic.
    • setShowArrow

      public void setShowArrow(boolean aVal)
      Sets whether menu is showing arrow graphic.
    • getItems

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

      public int getItemCount()
      Returns the number of items.
    • getItem

      public MenuItem getItem(int anIndex)
      Override to return child as MenuItem.
    • addItem

      public void addItem(MenuItem aMenuItem)
      Override to return child as MenuItem.
    • addSeparator

      public void addSeparator()
      Adds a separator.
    • getPopup

      public PopupWindow getPopup()
      Returns a popup node for this menu.
    • show

      public void show(View aView, double aX, double aY)
      Show menu.
    • hide

      public void hide()
      Hides the popup.
    • isPopupShowing

      public boolean isPopupShowing()
      Returns whether popup is showing.
    • hideAll

      protected void hideAll()
      Hides this menu and parent menus.
    • hideChildPopupWindows

      protected void hideChildPopupWindows()
      Hides child menu popup windows.
    • itemFiredActionEvent

      protected void itemFiredActionEvent(ViewEvent anEvent)
      Called when child MenuItem fires action.
    • fireActionEvent

      protected void fireActionEvent(ViewEvent anEvent)
      Override to show popup.
      Overrides:
      fireActionEvent in class ButtonBase
    • setTargeted

      protected void setTargeted(boolean aValue)
      Override to show if in MenuBar or Menu.
      Overrides:
      setTargeted in class MenuItem
    • getMenuShowing

      public Menu getMenuShowing()
      Returns the menu showing (or null).
    • getChildForName

      public View getChildForName(String aName)
      Override to include child menu items.
      Overrides:
      getChildForName in class ParentView
    • setOwner

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

      public Font getDefaultFont()
      Returns the default font.
      Overrides:
      getDefaultFont in class View
    • 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