public class UICheckbox extends UIParameterComponent implements UIControlTarget, UITriggerSource, UITriggerTarget, UIFocus
UIContextActions.Action
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
static int |
DEFAULT_HEIGHT |
static int |
DEFAULT_WIDTH |
protected boolean |
enabled |
protected boolean |
isMomentary |
useCommandEngine
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Constructor and Description |
---|
UICheckbox() |
UICheckbox(float w,
BooleanParameter p) |
UICheckbox(float x,
float y) |
UICheckbox(float x,
float y,
BooleanParameter p) |
UICheckbox(float x,
float y,
float w,
float h) |
UICheckbox(float x,
float y,
float w,
float h,
BooleanParameter p) |
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.
|
LXListenableNormalizedParameter |
getParameter() |
BooleanParameter |
getTriggerSource() |
BooleanParameter |
getTriggerTarget() |
boolean |
isActive() |
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
|
protected void |
onToggle(boolean active)
Subclasses may override this to handle changes to the button's state
|
UICheckbox |
removeParameter() |
UICheckbox |
setActive(boolean active) |
protected UICheckbox |
setActive(boolean active,
boolean pushToParameter) |
UICheckbox |
setEnabled(boolean enabled) |
UICheckbox |
setMomentary(boolean momentary) |
UICheckbox |
setParameter(BooleanParameter parameter) |
UICheckbox |
setTriggerable(boolean triggerable) |
UICheckbox |
toggle() |
getContextActions, getOscAddress, setNormalizedCommand, setUseCommandEngine
addToContainer, 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, 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
onKeyTyped, onMouseClicked, onMouseDragged, onMouseMoved, onMouseOut, onMouseOver, onMouseWheel
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
protected boolean active
protected boolean isMomentary
protected boolean enabled
public UICheckbox()
public UICheckbox(float w, BooleanParameter p)
public UICheckbox(float x, float y)
public UICheckbox(float x, float y, BooleanParameter p)
public UICheckbox(float x, float y, float w, float h)
public UICheckbox(float x, float y, float w, float h, BooleanParameter p)
public UICheckbox setEnabled(boolean enabled)
public UICheckbox setTriggerable(boolean triggerable)
public String getDescription()
UIObject
getDescription
in class UIObject
public LXListenableNormalizedParameter getParameter()
getParameter
in class UIParameterComponent
public UICheckbox removeParameter()
public UICheckbox setParameter(BooleanParameter parameter)
public UICheckbox setMomentary(boolean momentary)
protected void onDraw(UI ui, PGraphics pg)
UIObject
protected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIParameterComponent
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseReleased
in class UIParameterComponent
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueprotected void onKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyReleased
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valuepublic boolean isActive()
public UICheckbox setActive(boolean active)
protected UICheckbox setActive(boolean active, boolean pushToParameter)
public UICheckbox toggle()
protected void onToggle(boolean active)
active
- Whether button is activepublic LXParameter getControlTarget()
getControlTarget
in interface UIControlTarget
public BooleanParameter getTriggerSource()
getTriggerSource
in interface UITriggerSource
public BooleanParameter getTriggerTarget()
getTriggerTarget
in interface UITriggerTarget
LX library by Mark C. Slee. © 2012-2020