Package heronarts.glx.ui.component
Class UIDropMenu
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.component.UIParameterComponent
heronarts.glx.ui.component.UIDropMenu
- All Implemented Interfaces:
UIContextActions,UIControlTarget,UIFocus,UIKeyFocus,UIModulationTarget,UIMouseFocus,UITabFocus,LXLoopTask,LXParameterListener
- Direct Known Subclasses:
UIMidiSelector,UIViewSelector
public class UIDropMenu
extends UIParameterComponent
implements UIFocus, UIControlTarget, UIModulationTarget, LXParameterListener
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorderNested classes/interfaces inherited from interface heronarts.glx.ui.UIContextActions
UIContextActions.Action, UIContextActions.ContextAction -
Field Summary
Fields inherited from class heronarts.glx.ui.component.UIParameterComponent
DEFAULT_HEIGHT, useCommandEngineFields 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
ConstructorsConstructorDescriptionUIDropMenu(float w) UIDropMenu(float w, float h) UIDropMenu(float x, float y, float w) UIDropMenu(float x, float y, float w, float h) UIDropMenu(float x, float y, float w, float h, DiscreteParameter parameter) UIDropMenu(float x, float y, float w, DiscreteParameter parameter) UIDropMenu(float w, float h, DiscreteParameter parameter) UIDropMenu(float w, DiscreteParameter parameter) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()protected voiddrawDisabledBackground(UI ui, VGraphics vg) static voiddrawTriangle(UI ui, UI2dComponent component, VGraphics vg, float textOffsetY) Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.protected intFocus size for hashes drawn on the outline of the object.voidSubclasses 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 x, float y) Subclasses override to receive mouse eventsvoidInvoked when the value of a parameter is changed.setDirection(UIDropMenu.Direction direction) Sets the direction that this drop menu opens, up or downsetEnabled(boolean enabled) setMenuWidth(float menuWidth) setOptions(String[] options) Sets the list of string options to display in the menusetParameter(DiscreteParameter parameter) Methods inherited from class heronarts.glx.ui.component.UIParameterComponent
getContextActions, getOscAddress, onMouseReleased, setEnableContextActions, setModulationRangeCommand, setNormalizedCommand, setUseCommandEngineMethods 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, 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, 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
-
UIDropMenu
public UIDropMenu(float x, float y, float w) -
UIDropMenu
-
UIDropMenu
public UIDropMenu(float w) -
UIDropMenu
-
UIDropMenu
public UIDropMenu(float w, float h) -
UIDropMenu
-
UIDropMenu
public UIDropMenu(float x, float y, float w, float h) -
UIDropMenu
-
-
Method Details
-
setMenuWidth
-
getDescription
Description copied from class:UIObjectObjects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component. If no help is available, return null rather than an empty String.- Overrides:
getDescriptionin classUIObject- Returns:
- Helpful contextual string explaining function of this element
-
getParameter
- Specified by:
getParameterin classUIParameterComponent
-
setEnabled
-
setParameter
-
onParameterChanged
Description copied from interface:LXParameterListenerInvoked when the value of a parameter is changed.- Specified by:
onParameterChangedin interfaceLXParameterListener- Parameters:
p- The parameter that has changed its value
-
setDirection
Sets the direction that this drop menu opens, up or down- Parameters:
direction- Direction menu should open- Returns:
- this
-
setOptions
Sets the list of string options to display in the menu- Parameters:
options- Options array- Returns:
- this
-
getFocusSize
protected int getFocusSize()Description copied from class:UI2dComponentFocus size for hashes drawn on the outline of the object. May be overridden.- Overrides:
getFocusSizein classUI2dComponent- Returns:
- Focus hash line size
-
drawDisabledBackground
-
onDraw
Description copied from class:UI2dComponentSubclasses should override this method to perform their drawing functions.- Overrides:
onDrawin classUI2dComponent- Parameters:
ui- UI contextvg- Graphics context
-
drawTriangle
-
onMousePressed
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMousePressedin classUIParameterComponent- Parameters:
mouseEvent- Mouse eventx- x-coordinatey- 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
-
getControlTarget
- Specified by:
getControlTargetin interfaceUIControlTarget
-
getModulationTarget
- Specified by:
getModulationTargetin interfaceUIModulationTarget
-
dispose
public void dispose()
-