Package heronarts.glx.ui.component
Class UIContextMenu
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.UI2dContainer
heronarts.glx.ui.component.UIContextMenu
- All Implemented Interfaces:
UIContainer
,LXLoopTask
,Iterable<UIObject>
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.UI2dContainer
UI2dContainer.ArrowKeyFocus, UI2dContainer.Layout, UI2dContainer.Position
Nested 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
debug, debugName, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawBackground
(UI ui, VGraphics vg) protected void
drawBorder
(UI ui, VGraphics vg) float
float
Returns the height of scrolling content.protected void
Subclasses may override to draw some other kind of drop menuvoid
onKeyPressed
(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsvoid
onMouseMoved
(MouseEvent mouseEvent, float x, float y) Subclasses override to receive mouse eventsvoid
onMouseOut
(MouseEvent mouseEvent) Subclasses override to receive events when mouse moves out of this objectvoid
onMousePressed
(MouseEvent mouseEvent, float x, float y) Subclasses override to receive mouse eventssetActions
(UIContextActions.Action[] actions) setHighlight
(int highlight) setMaxHeight
(float maxHeight) setPadding
(float padding) setRowHeight
(float rowHeight) Methods inherited from class heronarts.glx.ui.UI2dContainer
addChildren, addTopLevelComponent, getBottomPadding, getChild, getChildren, getContentHeight, getContentTarget, getContentWidth, getLeftPadding, getRightPadding, getScrollWidth, getTopPadding, hasDragToReorder, iterator, newHorizontalContainer, newHorizontalContainer, newHorizontalContainer, newVerticalContainer, newVerticalContainer, newVerticalContainer, onReflow, reflow, removeAllChildren, removeAllChildren, setArrowKeyFocus, setChildMargin, setChildSpacing, setChildSpacing, setContentHeight, setContentSize, setContentTarget, setContentWidth, setDragToReorder, setLayout, setLayout, setMinHeight, setMinWidth, setPadding, setPadding
Methods inherited from class heronarts.glx.ui.UI2dComponent
addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getMappableParameter, getNextSibling, getParent, getPrevSibling, 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, vgRoundedRect
Methods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, blur, bringToFront, dispose, focus, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, toggleVisible, toString
Methods inherited from class heronarts.glx.ui.UIEventHandler
onKeyReleased, onMouseDragged, onMouseOver, onMouseReleased, onMouseScroll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
DEFAULT_WIDTH
public static final float DEFAULT_WIDTH- See Also:
-
-
Constructor Details
-
UIContextMenu
public UIContextMenu(float x, float y, float w, float h)
-
-
Method Details
-
getPadding
public float getPadding() -
setPadding
- Overrides:
setPadding
in classUI2dContainer
-
setRowHeight
-
setMaxHeight
-
setActions
-
getScrollHeight
public float getScrollHeight()Description copied from class:UI2dContainer
Returns the height of scrolling content. By default this is the same as the height of the container itself, but if the container scrolls then the scroll height may be a larger value.- Overrides:
getScrollHeight
in classUI2dContainer
- Returns:
- Height of scrollable content
-
setHighlight
-
drawBackground
- Overrides:
drawBackground
in classUI2dComponent
-
drawBorder
- Overrides:
drawBorder
in classUI2dComponent
-
onDraw
Subclasses may override to draw some other kind of drop menu- Overrides:
onDraw
in classUI2dContainer
- Parameters:
ui
- UI contextvg
- PGraphics context
-
onKeyPressed
Description copied from class:UIEventHandler
Subclasses override to receive key events- Overrides:
onKeyPressed
in classUI2dContainer
- Parameters:
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code value
-
onMouseOut
Description copied from class:UIEventHandler
Subclasses override to receive events when mouse moves out of this object- Overrides:
onMouseOut
in classUIEventHandler
- Parameters:
mouseEvent
- Mouse Event
-
onMouseMoved
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMouseMoved
in classUIEventHandler
- Parameters:
mouseEvent
- Mouse eventx
- x-coordinatey
- y-coordinate
-
onMousePressed
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMousePressed
in classUIEventHandler
- Parameters:
mouseEvent
- Mouse eventx
- x-coordinatey
- y-coordinate
-