public class UIToggleSet extends UIParameterComponent implements UIFocus, UIControlTarget, LXParameterListener
UIContextActions.ActionDEFAULT_HEIGHT, useCommandEnginebottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, ychildren, hasFocus, mousePressContextMenu, visible| Constructor and Description |
|---|
UIToggleSet() |
UIToggleSet(float x,
float y,
float w,
float h) |
| 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.
|
DiscreteParameter |
getParameter() |
int |
getSelectedIndex()
Gets the index of the currently selected value in the toggle set
|
String |
getSelectedOption()
Get the currently selected option in the toggle set
|
void |
onDraw(UI ui,
PGraphics pg)
Subclasses should override this method to perform their drawing functions.
|
protected void |
onKeyPressed(KeyEvent keyEvent,
char keyChar,
int keyCode)
Subclasses override to receive key events
|
protected void |
onMousePressed(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
void |
onParameterChanged(LXParameter parameter)
Invoked when the value of a parameter is changed.
|
protected void |
onResize()
Subclasses may override this method, invoked when the component is resized
|
protected void |
onToggle(int value)
Invoked when value is toggled.
|
protected void |
onToggle(String option)
Invoked when value is toggled, if subclass did not override the integer
version of this method.
|
UIToggleSet |
setEvenSpacing() |
UIToggleSet |
setOptions(String[] options) |
UIToggleSet |
setParameter(DiscreteParameter parameter) |
UIToggleSet |
setSelectedIndex(int index)
Sets the control to the given index in the options
|
UIToggleSet |
setSelectedOption(String option)
Sets the control to select the given option in the toggle set
|
getContextActions, getOscAddress, onMouseReleased, setNormalizedCommand, setUseCommandEngineaddToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getNextSibling, getParent, getPrevSibling, getWidth, getX, getY, hasBackground, hasBorder, hasFont, hasFontColor, isMappable, 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, setYaddLoopTask, beginDraw, blur, bringToFront, consumeKeyEvent, consumeMousePress, consumeMouseWheelEvent, endDraw, focus, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onBlur, onFocus, onUIResize, removeLoopTask, toggleVisibleonKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseWheelpublic UIToggleSet()
public UIToggleSet(float x,
float y,
float w,
float h)
public String getDescription()
UIObjectgetDescription in class UIObjectprotected void onResize()
UI2dComponentonResize in class UI2dComponentpublic UIToggleSet setOptions(String[] options)
public DiscreteParameter getParameter()
getParameter in class UIParameterComponentpublic UIToggleSet setParameter(DiscreteParameter parameter)
public void onParameterChanged(LXParameter parameter)
LXParameterListeneronParameterChanged in interface LXParameterListenerparameter - The parameter that has changed its valuepublic UIToggleSet setEvenSpacing()
public int getSelectedIndex()
public String getSelectedOption()
public UIToggleSet setSelectedOption(String option)
option - String value, must be one of the options in the toggle setpublic UIToggleSet setSelectedIndex(int index)
index - Index in the toggle set, from 0 to range-1public void onDraw(UI ui, PGraphics pg)
UIObjectprotected void onToggle(int value)
value - Selected index in the toggle setprotected void onToggle(String option)
option - Selected option in the toggle setprotected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandleronMousePressed in class UIParameterComponentmouseEvent - Mouse eventmx - x-coordinatemy - y-coordinateprotected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandleronKeyPressed in class UIEventHandlerkeyEvent - Key eventkeyChar - Key characterkeyCode - Key code valuepublic LXParameter getControlTarget()
getControlTarget in interface UIControlTargetLX library by Mark C. Slee. © 2012-2020