public class UISwitch extends UIParameterControl implements UIFocus, UITriggerTarget, UITriggerSource
UIInputBox.FillStyle, UIInputBox.ProgressIndicator
UIContextActions.Action
Modifier and Type | Field and Description |
---|---|
protected boolean |
isMomentary |
static int |
SWITCH_MARGIN |
static int |
SWITCH_SIZE |
static int |
WIDTH |
enabled, keyEditable, LABEL_HEIGHT, LABEL_MARGIN, parameter, polarity, TEXT_MARGIN
editable, editBuffer, editing, fillColor, fillStyle, hasFill, progressFillStyle, returnKeyEdit
DEFAULT_HEIGHT, useCommandEngine
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UISwitch(float x,
float y) |
Modifier and Type | Method and Description |
---|---|
BooleanParameter |
getTriggerSource() |
BooleanParameter |
getTriggerTarget() |
protected 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 |
onKeyReleased(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
|
protected void |
onMouseReleased(MouseEvent mouseEvent,
float mx,
float my)
Subclasses override to receive mouse events
|
UISwitch |
setMomentary(boolean momentary) |
UIParameterControl |
setParameter(LXNormalizedParameter parameter) |
decrementValue, getControlTarget, getDescription, getDescription, getFocusColor, getModulatedValueColor, getModulationSource, getModulationTarget, getNormalized, getParameter, getValueString, incrementValue, isEnabled, isValidCharacter, onBlur, onCopy, onParameterChanged, onPaste, saveEditBuffer, setEditable, setEnabled, setLabel, setNormalized, setPolarity, setShowLabel
edit, enableImmediateEdit, enableMousePressEdit, enableReturnKeyEdit, getEditBufferValue, getFillWidthNormalized, incrementMouseValue, isEditable, onMouseDragged, setProgressColor, setProgressColor, setProgressFillStyle, setProgressIndicator, setValueCommand
getContextActions, getOscAddress, setNormalizedCommand, setUseCommandEngine
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusSize, 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, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyTyped, onMouseClicked, onMouseMoved, onMouseOut, onMouseOver, onMouseWheel
public static final int SWITCH_MARGIN
public static final int SWITCH_SIZE
public static final int WIDTH
protected boolean isMomentary
public UISwitch setMomentary(boolean momentary)
public UIParameterControl setParameter(LXNormalizedParameter parameter)
setParameter
in class UIParameterControl
public BooleanParameter getTriggerTarget()
getTriggerTarget
in interface UITriggerTarget
public BooleanParameter getTriggerSource()
getTriggerSource
in interface UITriggerSource
protected void onDraw(UI ui, PGraphics pg)
UIObject
onDraw
in class UIParameterControl
ui
- UI contextpg
- Graphics contextprotected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIParameterControl
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueprotected void onKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyReleased
in class UIParameterControl
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueprotected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIParameterControl
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseReleased
in class UIParameterControl
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateLX library by Mark C. Slee. © 2012-2020