Package heronarts.glx.ui.component
Class UICheckbox
java.lang.Object
heronarts.glx.ui.UIEventHandler
heronarts.glx.ui.UIObject
heronarts.glx.ui.UI2dComponent
heronarts.glx.ui.component.UIParameterComponent
heronarts.glx.ui.component.UICheckbox
- All Implemented Interfaces:
UIContextActions
,UIControlTarget
,UIFocus
,UIKeyFocus
,UIMouseFocus
,UITabFocus
,UITriggerSource
,UITriggerTarget
,LXLoopTask
public class UICheckbox
extends UIParameterComponent
implements UIControlTarget, UITriggerSource, UITriggerTarget, UIFocus
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.UI2dComponent
UI2dComponent.Scissor, UI2dComponent.Scissored, UI2dComponent.UIDragReorder
Nested classes/interfaces inherited from interface heronarts.glx.ui.UIContextActions
UIContextActions.Action
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
static final int
static final int
protected boolean
protected boolean
Fields inherited from class heronarts.glx.ui.component.UIParameterComponent
useCommandEngine
Fields inherited from class heronarts.glx.ui.UI2dComponent
debug, debugName, height, marginBottom, marginLeft, marginRight, marginTop, redraw, scissor, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, width, x, y
-
Constructor Summary
ConstructorDescriptionUICheckbox
(float x, float y) UICheckbox
(float x, float y, float w, float h) UICheckbox
(float x, float y, float w, float h, BooleanParameter p) UICheckbox
(float x, float y, BooleanParameter p) UICheckbox
(float w, BooleanParameter p) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.boolean
isActive()
protected void
Subclasses should override this method to perform their drawing functions.protected void
onKeyPressed
(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected void
onKeyReleased
(KeyEvent keyEvent, char keyChar, int keyCode) Subclasses override to receive key eventsprotected void
onMousePressed
(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsprotected void
onMouseReleased
(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsprotected void
onToggle
(boolean active) Subclasses may override this to handle changes to the button's statesetActive
(boolean active) protected UICheckbox
setActive
(boolean active, boolean pushToParameter) setEnabled
(boolean enabled) setMomentary
(boolean momentary) setParameter
(BooleanParameter parameter) setTriggerable
(boolean triggerable) toggle()
Methods inherited from class heronarts.glx.ui.component.UIParameterComponent
getContextActions, getOscAddress, setEnableContextActions, setModulationRangeCommand, setNormalizedCommand, setUseCommandEngine
Methods inherited from class heronarts.glx.ui.UI2dComponent
addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, addToContainer, assertValidContainer, clipTextToWidth, clipTextToWidth, contains, dbch, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, drawParentBackground, getAbsoluteX, getAbsoluteY, getBackgroundColor, getBorderColor, getBorderWeight, getContainer, getDebugClassHierarchy, getDebugClassHierarchy, getFocusColor, getFocusSize, getFont, getFontColor, getHeight, getMappableParameter, getNextSibling, getParent, getPrevSibling, 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, vgRoundedRect
Methods inherited from class heronarts.glx.ui.UIObject
addListener, addListener, addLoopTask, blur, bringToFront, focus, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, loop, onBlur, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, toggleVisible, toString
Methods inherited from class heronarts.glx.ui.UIEventHandler
onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseScroll
-
Field Details
-
DEFAULT_WIDTH
public static final int DEFAULT_WIDTH- See Also:
-
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHT- See Also:
-
active
protected boolean active -
isMomentary
protected boolean isMomentary -
enabled
protected boolean enabled
-
-
Constructor Details
-
UICheckbox
public UICheckbox() -
UICheckbox
-
UICheckbox
public UICheckbox(float x, float y) -
UICheckbox
-
UICheckbox
public UICheckbox(float x, float y, float w, float h) -
UICheckbox
-
-
Method Details
-
setEnabled
-
setTriggerable
-
getDescription
Description copied from class:UIObject
Objects 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:
getDescription
in classUIObject
- Returns:
- Helpful contextual string explaining function of this element
-
getParameter
- Specified by:
getParameter
in classUIParameterComponent
-
removeParameter
-
setParameter
-
setMomentary
-
onDraw
Description copied from class:UI2dComponent
Subclasses should override this method to perform their drawing functions.- Overrides:
onDraw
in classUI2dComponent
- Parameters:
ui
- UI contextvg
- Graphics context
-
onMousePressed
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMousePressed
in classUIParameterComponent
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinate
-
onMouseReleased
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMouseReleased
in classUIParameterComponent
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinate
-
onKeyPressed
Description copied from class:UIEventHandler
Subclasses override to receive key events- Overrides:
onKeyPressed
in classUIEventHandler
- Parameters:
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code value
-
onKeyReleased
Description copied from class:UIEventHandler
Subclasses override to receive key events- Overrides:
onKeyReleased
in classUIEventHandler
- Parameters:
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code value
-
isActive
public boolean isActive() -
setActive
-
setActive
-
toggle
-
onToggle
protected void onToggle(boolean active) Subclasses may override this to handle changes to the button's state- Parameters:
active
- Whether button is active
-
getControlTarget
- Specified by:
getControlTarget
in interfaceUIControlTarget
-
getTriggerSource
- Specified by:
getTriggerSource
in interfaceUITriggerSource
-
getTriggerTarget
- Specified by:
getTriggerTarget
in interfaceUITriggerTarget
-
dispose
public void dispose()
-