Package heronarts.glx.ui.component
Class UISwitch
- All Implemented Interfaces:
UIContextActions,UIControlTarget,UICopy,UIFocus,UIKeyFocus,UIModulationSource,UIModulationTarget,UIMouseFocus,UIPaste,UITabFocus,UITriggerSource,UITriggerTarget,LXLoopTask,LXParameterListener
public class UISwitch
extends UIParameterControl
implements UIFocus, UITriggerTarget, UITriggerSource
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.component.UIInputBox
UIInputBox.EditState, UIInputBox.FillStyle, UIInputBox.ProgressIndicatorNested 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
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intstatic final intstatic final intFields inherited from class heronarts.glx.ui.component.UIParameterControl
enabled, keyEditable, LABEL_HEIGHT, LABEL_MARGIN, parameter, polarity, TEXT_MARGINFields inherited from class heronarts.glx.ui.component.UIInputBox
editable, editing, fillColor, fillStyle, hasFill, mouseEditable, returnKeyEditFields 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
ConstructorsConstructorDescriptionUISwitch()UISwitch(float x, float y) UISwitch(float x, float y, LXNormalizedParameter parameter) UISwitch(LXNormalizedParameter parameter) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSubclasses should override this method to perform their drawing functions.protected voidonKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected voidonKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected voidonMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected voidonMousePressed(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsprotected voidonMouseReleased(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsvoidonParameterChanged(LXParameter parameter) Invoked when the value of a parameter is changed.setMomentary(boolean momentary) setParameter(LXNormalizedParameter parameter) Methods inherited from class heronarts.glx.ui.component.UIParameterControl
decrementValue, dispose, drawParameterLabel, getBaseNormalized, getControlTarget, getDescription, getDescription, getFocusColor, getModulatedValueColor, getModulationSource, getModulationTarget, getParameter, getValueString, incrementValue, isEnabled, isShowLabel, isTriggerParameter, isValidCharacter, isWrappable, onBlur, onCopy, onPaste, saveEditBuffer, setEditable, setEnabled, setLabel, setNormalized, setPolarity, setShowLabelMethods inherited from class heronarts.glx.ui.component.UIInputBox
disableImmediateAppend, disableImmediateEdit, disableReturnKeyEdit, edit, edit, editAppend, enableImmediateAppend, enableImmediateEdit, enableReturnKeyEdit, getEditBuffer, getEditRange, getFillWidthNormalized, getInitialEditBufferValue, incrementMouseValue, isEditable, onDrawText, onEditChange, onEditFinished, setMouseEditable, setProgressColor, setProgressColor, setProgressColor, setProgressIndicator, setValueCommandMethods inherited from class heronarts.glx.ui.component.UIParameterComponent
getContextActions, getOscAddress, 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, getFocusSize, 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, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, setMouseCursor, toggleVisible, toStringMethods inherited from class heronarts.glx.ui.UIEventHandler
onGamepadAxisChanged, onGamepadButtonPressed, onGamepadButtonReleased, onMouseMoved, onMouseOut, onMouseOver, onMouseScroll
-
Field Details
-
SWITCH_MARGIN
public static final int SWITCH_MARGIN- See Also:
-
SWITCH_SIZE
public static final int SWITCH_SIZE- See Also:
-
WIDTH
public static final int WIDTH- See Also:
-
isMomentary
protected boolean isMomentary
-
-
Constructor Details
-
UISwitch
-
UISwitch
-
UISwitch
public UISwitch() -
UISwitch
public UISwitch(float x, float y)
-
-
Method Details
-
setMomentary
-
setParameter
- Overrides:
setParameterin classUIParameterControl
-
onParameterChanged
Description copied from interface:LXParameterListenerInvoked when the value of a parameter is changed.- Specified by:
onParameterChangedin interfaceLXParameterListener- Overrides:
onParameterChangedin classUIParameterControl- Parameters:
parameter- The parameter that has changed its value
-
getTriggerTarget
- Specified by:
getTriggerTargetin interfaceUITriggerTarget
-
getTriggerSource
- Specified by:
getTriggerSourcein interfaceUITriggerSource
-
onDraw
Description copied from class:UI2dComponentSubclasses should override this method to perform their drawing functions.- Overrides:
onDrawin classUIParameterControl- Parameters:
ui- UI contextvg- Graphics context
-
onKeyPressed
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyPressedin classUIParameterControl- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
onKeyReleased
Description copied from class:UIEventHandlerSubclasses override to receive key events- Overrides:
onKeyReleasedin classUIParameterControl- Parameters:
keyEvent- Key eventkeyChar- Key characterkeyCode- Key code value
-
onMousePressed
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMousePressedin classUIParameterControl- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-
onMouseDragged
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseDraggedin classUIInputBox- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinatedx- movement in xdy- movement in y
-
onMouseReleased
Description copied from class:UIEventHandlerSubclasses override to receive mouse events- Overrides:
onMouseReleasedin classUIParameterControl- Parameters:
mouseEvent- Mouse eventmx- x-coordinatemy- y-coordinate
-