Package snap.view
Class MenuButton
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.ParentView
snap.view.ButtonBase
snap.view.MenuButton
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
Button subclass to show a menu when clicked.
-
Nested Class Summary
Nested classes/interfaces inherited from class snap.view.View
View.Overflow
-
Field Summary
FieldsFields inherited from class snap.view.ButtonBase
_showArea, _targeted, BUTTON_NORMAL, BUTTON_OVER, BUTTON_PRESSED, ImageName_Prop, Position_Prop, Pressed_Prop, ShowArea_Prop, Targeted_Prop
Fields inherited from class snap.view.ParentView
_children, Children_Prop, NeedsLayout_Prop
Fields inherited from class snap.view.View
_align, _border, _borderRadius, _effect, _fill, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Cursor_Prop, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Overflow_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, RuntimeClassName_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, TextColor_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMenuItem
(MenuItem anItem) Adds a menu item.protected void
fromXMLChildren
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival for shape children.void
fromXMLView
(XMLArchiver anArchiver, XMLElement anElement) XML unarchival.getItemForName
(String aName) Returns the item for given name.getMenu()
Returns the menu.MenuItem[]
Returns the menu items.Returns the popup point.Returns the popup size.getPropValue
(String aPropName) Override to support props for this class.void
hideMenu()
Hides the menu.protected void
Override to support props for this class.boolean
Returns whether menu is showing.boolean
Returns whether button should show arrow.protected void
processEvent
(ViewEvent anEvent) Handle events.void
setMenuItems
(MenuItem[] theItems) Sets the menu items.void
Override to send to items.void
setPopupPoint
(Point aValue) Sets the popup point.void
setPopupSize
(double aW, double aH) Sets the popup size.void
setPopupSize
(Size aValue) Sets the popup size.void
setPopupXY
(double popupX, double popupY) Sets the popup point.void
setPropValue
(String aPropName, Object aValue) Override to support props for this class.void
setShowArrow
(boolean aValue) Sets whether button should show arrow.void
showMenu()
Shows the popup menu.protected void
toXMLChildren
(XMLArchiver anArchiver, XMLElement anElement) XML archival of children.toXMLView
(XMLArchiver anArchiver) XML archival.Methods inherited from class snap.view.ButtonBase
createActionEvent, fire, fireActionEvent, getGraphic, getGraphicAfter, getImage, getImageAfter, getImageName, getLabel, getPosition, getPrefHeightImpl, getPrefWidthImpl, getSharedAction, getText, getTextColor, getViewProxy, isPressed, isSelected, isShowArea, isTargeted, layoutImpl, paintAll, paintButton, paintFront, setDisabled, setGraphic, setGraphicAfter, setImage, setImageAfter, setImageName, setPosition, setPressed, setSharedAction, setShowArea, setTargeted, setText, setTextColor
Methods inherited from class snap.view.ParentView
addChild, addChild, addDeepChangeListener, childDidDeepChange, childDidPropChange, fromXML, getChild, getChildAtXY, getChildCount, getChildCountManaged, getChildForClass, getChildForName, getChildLast, getChildren, getChildrenArray, getChildrenForClass, getChildrenInPaintOrder, getChildrenManaged, getFocusNext, getFocusPrev, indexOfChild, intersectsShape, isInLayout, isNeedsLayout, isNeedsLayoutDeep, isNeedsRepaintDeep, layout, layoutDeep, layoutDeepImpl, layoutFloatingViews, paintChildren, parentFontChanged, processPropChange, relayout, removeChild, removeChild, removeChildren, removeDeepChangeListener, setChildren, setFont, setNeedsLayout, setNeedsLayoutDeep, setNeedsRepaintDeep, setOwnerChildren, setShowing, themeChanged, toXML
Methods inherited from class snap.view.View
addEventFilter, addEventHandler, clone, contains, contains, containsShape, disableEvents, enableEvents, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipBounds, getClipBoundsAll, getCursor, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOverflow, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefSize, getPrefWidth, getPrefWidth, getProp, getPropDefault, getProps, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getRuntimeClassName, getScale, getScaleX, getScaleY, getSize, getSpacing, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getValuePropName, getVisibleBounds, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, initStyleProps, isActionable, isAncestor, isAnimActive, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isPropDefault, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintAbove, paintBack, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEventAll, processEventFilters, processEventHandlers, relayoutParent, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlign, setAlignX, setAlignY, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClipToBounds, setCursor, setEffect, setEnabled, setFill, setFocusable, setFocused, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setGrowHeight, setGrowWidth, setHeight, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setOverflow, setPadding, setPadding, setPaintable, setParent, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setRotate, setRuntimeClassName, setScale, setScaleX, setScaleY, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setWidth, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, toStringProps
Methods inherited from class snap.props.PropObject
addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, processArchivedNode, processUnarchivedNode, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString
-
Field Details
-
MenuItems_Prop
- See Also:
-
ShowArrow_Prop
- See Also:
-
-
Constructor Details
-
MenuButton
public MenuButton()Constructor.
-
-
Method Details
-
getMenuItems
Returns the menu items. -
setMenuItems
Sets the menu items. -
addMenuItem
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
Returns the popup point. -
setPopupPoint
Sets the popup point. -
setPopupXY
public void setPopupXY(double popupX, double popupY) Sets the popup point. -
getPopupSize
Returns the popup size. -
setPopupSize
Sets the popup size. -
setPopupSize
public void setPopupSize(double aW, double aH) Sets the popup size. -
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
Handle events.- Overrides:
processEvent
in classButtonBase
-
getItemForName
Returns the item for given name. -
setOwner
Override to send to items.- Overrides:
setOwner
in classParentView
-
initProps
Override to support props for this class.- Overrides:
initProps
in classButtonBase
-
getPropValue
Override to support props for this class.- Overrides:
getPropValue
in classButtonBase
-
setPropValue
Override to support props for this class.- Overrides:
setPropValue
in classButtonBase
-
toXMLView
XML archival.- Overrides:
toXMLView
in classButtonBase
-
fromXMLView
XML unarchival.- Overrides:
fromXMLView
in classButtonBase
-
toXMLChildren
XML archival of children.- Overrides:
toXMLChildren
in classParentView
-
fromXMLChildren
XML unarchival for shape children.- Overrides:
fromXMLChildren
in classParentView
-