Package heronarts.glx.ui.component
Class UIContextButton
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.component.UIContextButton
- All Implemented Interfaces:
UIFocus,UIKeyFocus,UIMouseFocus,UITabFocus,LXLoopTask
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDirection that a context menu opens from a buttonstatic enumNested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder -
Field Summary
Fields inherited from class heronarts.glx.ui.UI2dComponent
borderRoundingBottomLeft, borderRoundingBottomRight, borderRoundingTopLeft, borderRoundingTopRight, debug, debugName, hasBorderRounding, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y -
Constructor Summary
ConstructorsConstructorDescriptionUIContextButton(UI ui, float x, float y, float w, float h) UIContextButton(UI ui, float x, float y, float w, float h, UI2dComponent contextMenu) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Accessor for the underlying context menu objectvoidSubclasses should override this method to perform their drawing functions.voidonKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsvoidonMousePressed(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsvoidonMouseReleased(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventssetContextActions(UIContextActions.Action[] contextActions) Sets an array of actions that will be shown in the context menu that opens when the button is clickedsetContextMenuWidth(float contextMenuWidth) Sets the width of the context menu opened by this buttonsetDirection(UIContextButton.Direction direction) Sets the direction in which the context menu openssetHorizontalDirection(UIContextButton.HorizontalDirection horizontalDirection) Sets the direction in which the context menu openssetIcon(VGraphics.Image icon) setIconOffset(float iconOffsetX, float iconOffsetY) Sets the label visible on the buttonMethods inherited from class heronarts.glx.ui.UI2dComponent
addAfterSibling, addBeforeSibling, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawBackground, drawBorder, drawComponentBackground, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getBottomMargin, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getLeftMargin, getMappableParameter, getNextSibling, getNextSibling, getParent, getPrevSibling, getPrevSibling, getRightMargin, getTopMargin, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, removeFromContainer, setBackground, setBackgroundColor, setBackgroundColor, setBorder, setBorderColor, setBorderColor, setBorderRounding, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setContainerPosition, setDebug, setDebug, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusBackgroundColor, setFocusColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY, vgRoundedRect, vgRoundedRect, vgRoundedRectMethods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, addLoopTask, blur, bringToFront, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, setMouseCursor, toggleVisible, toStringMethods inherited from class heronarts.glx.ui.UIEventHandler
onGamepadAxisChanged, onGamepadButtonPressed, onGamepadButtonReleased, onKeyReleased, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseScroll
-
Constructor Details
-
UIContextButton
-
UIContextButton
-
-
Method Details
-
setIcon
-
setIconOffset
-
getContextMenu
Accessor for the underlying context menu object- Returns:
- Context menu object opened by this button
-
setContextMenuWidth
Sets the width of the context menu opened by this button- Parameters:
contextMenuWidth- Width of context menu- Returns:
- this
-
setContextActions
Sets an array of actions that will be shown in the context menu that opens when the button is clicked- Parameters:
contextActions- Set of context actions shown when button is clicked- Returns:
- this
-
setLabel
Sets the label visible on the button- Parameters:
label- Label- Returns:
- this
-
setDirection
Sets the direction in which the context menu opens- Parameters:
direction- Direction to open- Returns:
- this
-
setHorizontalDirection
public UIContextButton setHorizontalDirection(UIContextButton.HorizontalDirection horizontalDirection) Sets the direction in which the context menu opens- Parameters:
horizontalDirection- Direction to open- Returns:
- this
-
onDraw
Description copied from class:UI2dComponentSubclasses should override this method to perform their drawing functions.- Overrides:
onDrawin classUI2dComponent- Parameters:
ui- UI contextvg- Graphics context
-
onMousePressed
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMousePressedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onMouseReleased
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseReleasedin classUIEventHandler- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onKeyPressed
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyPressedin classUIEventHandler- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
dispose
public void dispose()
-