Package heronarts.glx.ui.component
Class UIIntegerBox
- All Implemented Interfaces:
UIContextActions
,UIControlTarget
,UIFocus
,UIKeyFocus
,UIModulationTarget
,UIMouseFocus
,UITabFocus
,LXLoopTask
- Direct Known Subclasses:
UIEnumBox
-
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
ConstructorDescriptionUIIntegerBox
(float x, float y, float w, float h) UIIntegerBox
(float x, float y, float w, float h, DiscreteParameter parameter) UIIntegerBox
(float w, float h, DiscreteParameter parameter) UIIntegerBox
(float w, DiscreteParameter parameter) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
decrementValue
(KeyEvent keyEvent) Subclasses may optionally override to decrement value in response to arrows.void
dispose()
Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.protected double
int
getValue()
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) protected void
onValueChange
(int value) Subclasses may override to handle value changesprotected void
saveEditBuffer
(String editBuffer) setParameter
(DiscreteParameter parameter) setRange
(int minValue, int maxValue) Sets the range of the input box, inclusivesetValue
(int value) protected UIIntegerBox
setValue
(int value, boolean pushToParameter) setWrappable
(boolean wrappable) Sets whether the box is wrappable, only applies when there is not a parameter set.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, onMouseDragged, 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
-
Field Details
-
parameter
-
-
Constructor Details
-
UIIntegerBox
public UIIntegerBox() -
UIIntegerBox
public UIIntegerBox(float x, float y, float w, float h) -
UIIntegerBox
-
UIIntegerBox
-
UIIntegerBox
-
-
Method Details
-
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
-
setWrappable
Sets whether the box is wrappable, only applies when there is not a parameter set.- Parameters:
wrappable
- Whether box is wrappable when no parameter set- Returns:
- This
-
setRange
Sets the range of the input box, inclusive- Parameters:
minValue
- Minimum value (inclusive)maxValue
- Maximum value (inclusive)- Returns:
- this
-
getFillWidthNormalized
protected double getFillWidthNormalized()- Overrides:
getFillWidthNormalized
in classUIInputBox
-
getValue
public int getValue() -
getValueString
- Specified by:
getValueString
in classUIInputBox
-
setValue
-
setValue
-
onValueChange
protected void onValueChange(int value) Subclasses may override to handle value changes- Parameters:
value
- New value being set
-
saveEditBuffer
- Specified by:
saveEditBuffer
in classUIInputBox
-
isValidCharacter
protected boolean isValidCharacter(char keyChar) - Specified by:
isValidCharacter
in classUIInputBox
-
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
-
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
-
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
-
getModulationTarget
- Specified by:
getModulationTarget
in interfaceUIModulationTarget
-
dispose
public void dispose()- Overrides:
dispose
in classUINumberBox
-