public abstract class UIParameterControl extends UIInputBox implements UIControlTarget, UIModulationTarget, UIModulationSource, LXParameterListener, UICopy, UIPaste
UIInputBox.FillStyle, UIInputBox.ProgressIndicator
UIContextActions.Action
Modifier and Type | Field and Description |
---|---|
protected boolean |
enabled |
protected boolean |
keyEditable |
protected static int |
LABEL_HEIGHT |
protected static int |
LABEL_MARGIN |
protected LXNormalizedParameter |
parameter |
protected LXParameter.Polarity |
polarity |
static int |
TEXT_MARGIN |
editable, editBuffer, editing, fillColor, fillStyle, hasFill, progressFillStyle, returnKeyEdit
DEFAULT_HEIGHT, useCommandEngine
bottomMargin, height, leftMargin, rightMargin, textAlignHorizontal, textAlignVertical, textOffsetX, textOffsetY, topMargin, width, x, y
children, hasFocus, mousePressContextMenu, visible
Modifier | Constructor and Description |
---|---|
protected |
UIParameterControl(float x,
float y,
float w,
float h) |
Modifier and Type | Method and Description |
---|---|
protected void |
decrementValue(KeyEvent keyEvent)
Subclasses may optionally override to decrement value in response to arrows.
|
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.
|
static String |
getDescription(LXParameter parameter) |
protected int |
getFocusColor(UI ui) |
int |
getModulatedValueColor(int baseColor)
Given a base color for a control, return the color used to display the modulated component of its value.
|
LXNormalizedParameter |
getModulationSource() |
CompoundParameter |
getModulationTarget() |
protected double |
getNormalized() |
LXNormalizedParameter |
getParameter() |
protected String |
getValueString() |
protected void |
incrementValue(KeyEvent keyEvent)
Subclasses may optionally override to decrement value in response to arrows.
|
boolean |
isEnabled() |
protected boolean |
isValidCharacter(char keyChar) |
protected void |
onBlur()
Subclasses override when element loses focus
|
LXClipboardItem |
onCopy() |
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
|
void |
onParameterChanged(LXParameter parameter)
Invoked when the value of a parameter is changed.
|
void |
onPaste(LXClipboardItem item) |
protected void |
saveEditBuffer() |
UIInputBox |
setEditable(boolean editable) |
UIParameterControl |
setEnabled(boolean enabled) |
UIParameterControl |
setLabel(String label) |
protected UIParameterControl |
setNormalized(double normalized) |
UIParameterControl |
setParameter(LXNormalizedParameter parameter) |
UIParameterControl |
setPolarity(LXParameter.Polarity polarity) |
UIParameterControl |
setShowLabel(boolean showLabel) |
edit, enableImmediateEdit, enableMousePressEdit, enableReturnKeyEdit, getEditBufferValue, getFillWidthNormalized, incrementMouseValue, isEditable, onMouseDragged, setProgressColor, setProgressColor, setProgressFillStyle, setProgressIndicator, setValueCommand
getContextActions, getOscAddress, setNormalizedCommand, setUseCommandEngine
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, 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, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyTyped, onMouseClicked, onMouseMoved, onMouseOut, onMouseOver, onMouseWheel
protected static final int LABEL_MARGIN
protected static final int LABEL_HEIGHT
public static final int TEXT_MARGIN
protected LXNormalizedParameter parameter
protected LXParameter.Polarity polarity
protected boolean enabled
protected boolean keyEditable
protected UIParameterControl(float x, float y, float w, float h)
public UIParameterControl setEnabled(boolean enabled)
setEnabled
in class UIInputBox
public static String getDescription(LXParameter parameter)
public String getDescription()
UIObject
getDescription
in class UIObject
public boolean isEnabled()
isEnabled
in class UIInputBox
public UIInputBox setEditable(boolean editable)
setEditable
in class UIInputBox
public UIParameterControl setShowLabel(boolean showLabel)
public UIParameterControl setLabel(String label)
protected int getFocusColor(UI ui)
getFocusColor
in class UI2dComponent
public void onParameterChanged(LXParameter parameter)
LXParameterListener
onParameterChanged
in interface LXParameterListener
parameter
- The parameter that has changed its valueprotected double getNormalized()
protected UIParameterControl setNormalized(double normalized)
public LXNormalizedParameter getParameter()
getParameter
in class UIParameterComponent
public UIParameterControl setPolarity(LXParameter.Polarity polarity)
public UIParameterControl setParameter(LXNormalizedParameter parameter)
protected String getValueString()
getValueString
in class UIInputBox
protected boolean isValidCharacter(char keyChar)
isValidCharacter
in class UIInputBox
protected void saveEditBuffer()
saveEditBuffer
in class UIInputBox
protected void onDraw(UI ui, PGraphics pg)
UIObject
onDraw
in class UIInputBox
ui
- UI contextpg
- Graphics contextprotected void decrementValue(KeyEvent keyEvent)
decrementValue
in class UIInputBox
keyEvent
- Key event in response toprotected void incrementValue(KeyEvent keyEvent)
incrementValue
in class UIInputBox
keyEvent
- Key event in response toprotected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIInputBox
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 valueprotected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIInputBox
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseReleased
in class UIInputBox
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onBlur()
UIObject
onBlur
in class UIInputBox
public LXParameter getControlTarget()
getControlTarget
in interface UIControlTarget
public LXNormalizedParameter getModulationSource()
getModulationSource
in interface UIModulationSource
public CompoundParameter getModulationTarget()
getModulationTarget
in interface UIModulationTarget
public int getModulatedValueColor(int baseColor)
baseColor
- Base color to determine modulated color frompublic LXClipboardItem onCopy()
public void onPaste(LXClipboardItem item)
LX library by Mark C. Slee. © 2012-2020