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

  • 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.
    • getMenuItems

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

      public void setMenuItems(MenuItem[] theItems)
      Sets the child menu items.
    • 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.
    • showMenu

      public void showMenu()
      Show menu.
    • showMenuAtXY

      public void showMenuAtXY(View aView, double menuX, double menuY)
      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()
      Called when child MenuItem fires action.
    • fireActionEvent

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

      protected void setTargeted(boolean aValue)
      Override to show if in MenuBar or Menu.
      Overrides:
      setTargeted in class MenuItem
    • 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
    • initProps

      protected void initProps(PropSet aPropSet)
      Override to customize for this class.
      Overrides:
      initProps in class MenuItem
    • getPropValue

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

      public void setPropValue(String aPropName, Object aValue)
      Override to support props for this class.
      Overrides:
      setPropValue in class MenuItem
    • 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