Class UIParameterControl

All Implemented Interfaces:
UIContextActions, UIControlTarget, UICopy, UIFocus, UIKeyFocus, UIModulationSource, UIModulationTarget, UIMouseFocus, UIPaste, UITabFocus, LXLoopTask, LXParameterListener
Direct Known Subclasses:
UICompoundParameterControl, UISwitch

public abstract class UIParameterControl extends UIInputBox implements UIControlTarget, UIModulationTarget, UIModulationSource, LXParameterListener, UICopy, UIPaste
  • Field Details

  • Constructor Details

    • UIParameterControl

      protected UIParameterControl(float x, float y, float w, float h)
  • Method Details

    • setEnabled

      public UIParameterControl setEnabled(boolean enabled)
      Overrides:
      setEnabled in class UIInputBox
    • getDescription

      public static String getDescription(LXParameter parameter)
    • 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
    • isEnabled

      public boolean isEnabled()
      Overrides:
      isEnabled in class UIInputBox
    • setEditable

      public UIInputBox setEditable(boolean editable)
      Overrides:
      setEditable in class UIInputBox
    • setShowLabel

      public UIParameterControl setShowLabel(boolean showLabel)
    • isShowLabel

      public boolean isShowLabel()
    • setLabel

      public UIParameterControl setLabel(String label)
    • getFocusColor

      protected UIColor getFocusColor(UI ui)
      Overrides:
      getFocusColor in class UI2dComponent
    • onParameterChanged

      public void onParameterChanged(LXParameter parameter)
      Description copied from interface: LXParameterListener
      Invoked when the value of a parameter is changed.
      Specified by:
      onParameterChanged in interface LXParameterListener
      Parameters:
      parameter - The parameter that has changed its value
    • getBaseNormalized

      protected double getBaseNormalized()
    • setNormalized

      protected UIParameterControl setNormalized(double normalized)
    • getParameter

      public LXNormalizedParameter getParameter()
      Specified by:
      getParameter in class UIParameterComponent
    • setPolarity

      public UIParameterControl setPolarity(LXParameter.Polarity polarity)
    • setParameter

      public UIParameterControl setParameter(LXNormalizedParameter parameter)
    • getValueString

      protected String getValueString()
      Specified by:
      getValueString in class UIInputBox
    • isWrappable

      protected boolean isWrappable()
    • isValidCharacter

      protected boolean isValidCharacter(char keyChar)
      Specified by:
      isValidCharacter in class UIInputBox
    • saveEditBuffer

      protected void saveEditBuffer(String editBuffer)
      Specified by:
      saveEditBuffer in class UIInputBox
    • 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 UIInputBox
      Parameters:
      ui - UI context
      vg - Graphics context
    • drawParameterLabel

      public static void drawParameterLabel(UI ui, VGraphics vg, UI2dComponent component, String labelText)
    • decrementValue

      protected void decrementValue(KeyEvent keyEvent)
      Subclasses may optionally override to decrement value in response to arrows. Decrement is invoked for the left or down arrow keys.
      Overrides:
      decrementValue in class UIInputBox
      Parameters:
      keyEvent - Key event in response to
    • incrementValue

      protected void incrementValue(KeyEvent keyEvent)
      Subclasses may optionally override to decrement value in response to arrows. Increment is invoked for the right or up keys.
      Overrides:
      incrementValue in class UIInputBox
      Parameters:
      keyEvent - Key event in response to
    • 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 UIInputBox
      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
    • 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 UIInputBox
      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 UIInputBox
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
    • onBlur

      protected void onBlur()
      Description copied from class: UIObject
      Subclasses override when element loses focus
      Overrides:
      onBlur in class UIInputBox
    • getControlTarget

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

      public LXNormalizedParameter getModulationSource()
      Specified by:
      getModulationSource in interface UIModulationSource
    • getModulationTarget

      public LXCompoundModulation.Target getModulationTarget()
      Specified by:
      getModulationTarget in interface UIModulationTarget
    • getModulatedValueColor

      public int getModulatedValueColor(int baseColor)
      Given a base color for a control, return the color used to display the modulated component of its value. Currently, just dims the base color.
      Parameters:
      baseColor - Base color to determine modulated color from
      Returns:
      Color to use for modulated value
    • onCopy

      public LXClipboardItem onCopy()
      Specified by:
      onCopy in interface UICopy
    • onPaste

      public void onPaste(LXClipboardItem item)
      Specified by:
      onPaste in interface UIPaste
    • dispose

      public void dispose()
      Overrides:
      dispose in class UIObject