public class UIDropMenu extends UIParameterComponent implements UIFocus, UIControlTarget, LXParameterListener
Modifier and Type | Class and Description |
---|---|
static class |
UIDropMenu.Direction |
UIContextActions.Action
DEFAULT_HEIGHT, useCommandEngine
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UIDropMenu(float w,
DiscreteParameter parameter) |
UIDropMenu(float w,
float h,
DiscreteParameter parameter) |
UIDropMenu(float x,
float y,
float w,
float h) |
UIDropMenu(float x,
float y,
float w,
float h,
DiscreteParameter parameter) |
Modifier and Type | Method and Description |
---|---|
LXParameter |
getControlTarget() |
String |
getDescription()
Objects are encouraged to override this method providing a helpful String displayed to the user explaining
the function of this UI component.
|
protected int |
getFocusSize()
Focus size for hashes drawn on the outline of the object.
|
DiscreteParameter |
getParameter() |
void |
onDraw(UI ui,
PGraphics pg)
Subclasses should override this method to perform their drawing functions.
|
void |
onKeyPressed(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
void |
onMousePressed(MouseEvent mouseEvent,
float x,
float y)
Subclasses override to receive mouse events
|
void |
onParameterChanged(LXParameter p)
Invoked when the value of a parameter is changed.
|
UIDropMenu |
setDirection(UIDropMenu.Direction direction)
Sets the direction that this drop menu opens, up or down
|
UIDropMenu |
setEnabled(boolean enabled) |
UIDropMenu |
setOptions(String[] options)
Sets the list of string options to display in the menu
|
UIDropMenu |
setParameter(DiscreteParameter parameter) |
getContextActions, getOscAddress, onMouseReleased, setNormalizedCommand, setUseCommandEngine
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, onResize, redraw, removeFromContainer, setBackground, setBackgroundColor, setBorder, setBorderColor, setBorderRounding, setBorderWeight, setBottomMargin, setContainerIndex, setDescription, setFocusBackground, setFocusBackgroundColor, setFocusColor, setFocusCorners, setFont, setFontColor, setFontColor, setHeight, setLeftMargin, setMappable, setMargin, setMargin, setMargin, setPosition, setPosition, setPosition, setPosition, setRightMargin, setSize, setTextAlignment, setTextAlignment, setTextOffset, setTopMargin, setVisible, setWidth, setX, setY
addLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onBlur, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseWheel
public UIDropMenu(float x, float y, float w, float h)
public UIDropMenu(float w, DiscreteParameter parameter)
public UIDropMenu(float w, float h, DiscreteParameter parameter)
public UIDropMenu(float x, float y, float w, float h, DiscreteParameter parameter)
public String getDescription()
UIObject
getDescription
in class UIObject
public DiscreteParameter getParameter()
getParameter
in class UIParameterComponent
public UIDropMenu setEnabled(boolean enabled)
public UIDropMenu setParameter(DiscreteParameter parameter)
public void onParameterChanged(LXParameter p)
LXParameterListener
onParameterChanged
in interface LXParameterListener
p
- The parameter that has changed its valuepublic UIDropMenu setDirection(UIDropMenu.Direction direction)
direction
- Direction menu should openpublic UIDropMenu setOptions(String[] options)
options
- Options arrayprotected int getFocusSize()
UI2dComponent
getFocusSize
in class UI2dComponent
public void onDraw(UI ui, PGraphics pg)
UIObject
public void onMousePressed(MouseEvent mouseEvent, float x, float y)
UIEventHandler
onMousePressed
in class UIParameterComponent
mouseEvent
- Mouse eventx
- x-coordinatey
- y-coordinatepublic void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valuepublic LXParameter getControlTarget()
getControlTarget
in interface UIControlTarget
LX library by Mark C. Slee. © 2012-2020