Package heronarts.glx.ui.component
Class UIDoubleBox
- All Implemented Interfaces:
UIContextActions
,UIControlTarget
,UIFocus
,UIKeyFocus
,UIModulationSource
,UIModulationTarget
,UIMouseFocus
,UITabFocus
,LXLoopTask
public class UIDoubleBox
extends UINumberBox
implements UIControlTarget, UIModulationSource, UIModulationTarget
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.glx.ui.component.UIInputBox
UIInputBox.EditState, UIInputBox.FillStyle, UIInputBox.ProgressIndicator
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
Fields inherited from class heronarts.glx.ui.component.UINumberBox
hasShiftMultiplier, shiftMultiplier
Fields inherited from class heronarts.glx.ui.component.UIInputBox
editable, editing, enabled, fillColor, fillStyle, hasFill, mouseEditable, returnKeyEdit
Fields inherited from class heronarts.glx.ui.component.UIParameterComponent
DEFAULT_HEIGHT, 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
ConstructorDescriptionUIDoubleBox
(float x, float y, float w, float h) UIDoubleBox
(float x, float y, float w, float h, BoundedParameter parameter) UIDoubleBox
(float x, float y, float w, BoundedParameter parameter) UIDoubleBox
(float w, float h, BoundedParameter parameter) UIDoubleBox
(float w, BoundedParameter parameter) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
decrementValue
(KeyEvent keyEvent) Subclasses may optionally override to decrement value in response to arrows.void
dispose()
protected double
Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.protected double
double
getValue()
protected String
protected void
incrementMouseValue
(MouseEvent mouseEvent, int offset) Subclasses may optionally implement to change value based upon mouse click+drag in the box.protected void
incrementValue
(KeyEvent keyEvent) Subclasses may optionally override to decrement value in response to arrows.protected boolean
isValidCharacter
(char keyChar) static boolean
isValidInputCharacter
(char keyChar) protected void
onMouseDragged
(MouseEvent mouseEvent, float mx, float my, float dx, float dy) Subclasses override to receive mouse eventsprotected void
onValueChange
(double value) Invoked when value changes, subclasses may override to handle.protected void
saveEditBuffer
(String editBuffer) setNormalized
(double normalized) setNormalizedMouseEditing
(boolean normalizedMouseEditing) setParameter
(BoundedParameter parameter) setRange
(double minValue, double maxValue) setValue
(double value) protected UIDoubleBox
setValue
(double value, boolean pushToParameter) protected UIDoubleBox
Methods inherited from class heronarts.glx.ui.component.UINumberBox
drawBorder, getContextActions, onMousePressed, setFill, setFillColor, setFillStyle, setModulationTarget, setShiftMultiplier
Methods inherited from class heronarts.glx.ui.component.UIInputBox
disableImmediateAppend, disableImmediateEdit, disableReturnKeyEdit, edit, edit, editAppend, enableImmediateAppend, enableImmediateEdit, enableReturnKeyEdit, getEditBuffer, getEditRange, getInitialEditBufferValue, isEditable, isEnabled, onBlur, onDraw, onDrawText, onEditChange, onEditFinished, onKeyPressed, onMouseReleased, setEditable, setEnabled, setMouseEditable, setProgressColor, setProgressColor, setProgressColor, setProgressIndicator, setValueCommand
Methods inherited from class heronarts.glx.ui.component.UIParameterComponent
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, 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, onFocus, onUIResize, removeLoopTask, requireUIThread, setConsumeMousePress, setDebugId, toggleVisible, toString
Methods inherited from class heronarts.glx.ui.UIEventHandler
onKeyReleased, onMouseMoved, onMouseOut, onMouseOver, onMouseScroll
-
Constructor Details
-
UIDoubleBox
public UIDoubleBox() -
UIDoubleBox
public UIDoubleBox(float x, float y, float w, float h) -
UIDoubleBox
-
UIDoubleBox
-
UIDoubleBox
-
UIDoubleBox
-
-
Method Details
-
setNormalizedMouseEditing
-
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
-
setParameter
-
setRange
-
getBaseNormalized
protected double getBaseNormalized() -
setNormalized
-
getFillWidthNormalized
protected double getFillWidthNormalized()- Overrides:
getFillWidthNormalized
in classUIInputBox
-
getValue
public double getValue() -
setValue
-
setValue
-
setValue
-
getValueString
- Specified by:
getValueString
in classUIInputBox
-
onValueChange
protected void onValueChange(double value) Invoked when value changes, subclasses may override to handle.- Parameters:
value
- New value that is being set
-
saveEditBuffer
- Specified by:
saveEditBuffer
in classUIInputBox
-
isValidInputCharacter
public static boolean isValidInputCharacter(char keyChar) -
isValidCharacter
protected boolean isValidCharacter(char keyChar) - Specified by:
isValidCharacter
in classUIInputBox
-
decrementValue
Description copied from class:UIInputBox
Subclasses may optionally override to decrement value in response to arrows. Decrement is invoked for the left or down arrow keys.- Overrides:
decrementValue
in classUIInputBox
- Parameters:
keyEvent
- Key event
-
incrementValue
Description copied from class:UIInputBox
Subclasses may optionally override to decrement value in response to arrows. Increment is invoked for the right or up keys.- Overrides:
incrementValue
in classUIInputBox
- Parameters:
keyEvent
- Key event
-
incrementMouseValue
Description copied from class:UIInputBox
Subclasses may optionally implement to change value based upon mouse click+drag in the box.- Overrides:
incrementMouseValue
in classUIInputBox
- Parameters:
mouseEvent
- Mouse eventoffset
- Units of mouse movement, positive or negative
-
getControlTarget
- Specified by:
getControlTarget
in interfaceUIControlTarget
-
getModulationSource
- Specified by:
getModulationSource
in interfaceUIModulationSource
-
getModulationTarget
- Specified by:
getModulationTarget
in interfaceUIModulationTarget
-
onMouseDragged
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMouseDragged
in classUIInputBox
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatedx
- movement in xdy
- movement in y
-
dispose
public void dispose()- Overrides:
dispose
in classUINumberBox
-