Class UICheckbox

All Implemented Interfaces:
UIContextActions, UIControlTarget, UIFocus, UIKeyFocus, UIMouseFocus, UITabFocus, UITriggerSource, UITriggerTarget, LXLoopTask

public class UICheckbox extends UIParameterComponent implements UIControlTarget, UITriggerSource, UITriggerTarget, UIFocus
  • 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

      public UICheckbox(float w, BooleanParameter p)
    • UICheckbox

      public UICheckbox(float x, float y)
    • UICheckbox

      public UICheckbox(float x, float y, BooleanParameter p)
    • UICheckbox

      public UICheckbox(float x, float y, float w, float h)
    • UICheckbox

      public UICheckbox(float x, float y, float w, float h, BooleanParameter p)
  • Method Details

    • setEnabled

      public UICheckbox setEnabled(boolean enabled)
    • setTriggerable

      public UICheckbox setTriggerable(boolean triggerable)
    • getDescription

      public String 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 class UIObject
      Returns:
      Helpful contextual string explaining function of this element
    • getParameter

      public LXListenableNormalizedParameter getParameter()
      Specified by:
      getParameter in class UIParameterComponent
    • removeParameter

      public UICheckbox removeParameter()
    • setParameter

      public UICheckbox setParameter(BooleanParameter parameter)
    • setMomentary

      public UICheckbox setMomentary(boolean momentary)
    • onDraw

      protected void onDraw(UI ui, VGraphics vg)
      Description copied from class: UI2dComponent
      Subclasses should override this method to perform their drawing functions.
      Overrides:
      onDraw in class UI2dComponent
      Parameters:
      ui - UI context
      vg - Graphics context
    • onMousePressed

      protected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
      Description copied from class: UIEventHandler
      Subclasses override to receive mouse events
      Overrides:
      onMousePressed in class UIParameterComponent
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
    • onMouseReleased

      protected void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
      Description copied from class: UIEventHandler
      Subclasses override to receive mouse events
      Overrides:
      onMouseReleased in class UIParameterComponent
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
    • onKeyPressed

      protected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
      Description copied from class: UIEventHandler
      Subclasses override to receive key events
      Overrides:
      onKeyPressed in class UIEventHandler
      Parameters:
      keyEvent - Key event
      keyChar - Key character
      keyCode - Key code value
    • onKeyReleased

      protected void onKeyReleased(KeyEvent keyEvent, char keyChar, int keyCode)
      Description copied from class: UIEventHandler
      Subclasses override to receive key events
      Overrides:
      onKeyReleased in class UIEventHandler
      Parameters:
      keyEvent - Key event
      keyChar - Key character
      keyCode - Key code value
    • isActive

      public boolean isActive()
    • setActive

      public UICheckbox setActive(boolean active)
    • setActive

      protected UICheckbox setActive(boolean active, boolean pushToParameter)
    • toggle

      public UICheckbox 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

      public LXNormalizedParameter getControlTarget()
      Specified by:
      getControlTarget in interface UIControlTarget
    • getTriggerSource

      public BooleanParameter getTriggerSource()
      Specified by:
      getTriggerSource in interface UITriggerSource
    • getTriggerTarget

      public BooleanParameter getTriggerTarget()
      Specified by:
      getTriggerTarget in interface UITriggerTarget
    • dispose

      public void dispose()
      Overrides:
      dispose in class UIObject