Package heronarts.glx.ui.component
Class UITextBox
- All Implemented Interfaces:
UIContextActions
,UICopy
,UIFocus
,UIKeyFocus
,UIMouseFocus
,UIPaste
,UITabFocus
,LXLoopTask
- Direct Known Subclasses:
UIFileNameBox
-
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.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
ConstructorDescriptionUITextBox
(float w, float h) UITextBox
(float x, float y, float w, float h) UITextBox
(float x, float y, float w, float h, StringParameter parameter) UITextBox
(float w, float h, StringParameter parameter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
void
focusKeyPress
(KeyEvent keyEvent, char keyChar, int keyCode) Gives the text box focus and processes the key event which just occurred which would give it focusObjects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component.protected String
getValue()
protected String
boolean
isValidCharacter
(char keyChar) static boolean
isValidTextCharacter
(char keyChar) onCopy()
protected void
onMousePressed
(MouseEvent mouseEvent, float mx, float my) Subclasses override to receive mouse eventsvoid
onPaste
(LXClipboardItem item) protected void
onValueChange
(String value) Subclasses may override to handle value changesprotected void
saveEditBuffer
(String editBuffer) setEmptyValueAllowed
(boolean isEmptyValueAllowed) setParameter
(StringParameter parameter) setValidCharacters
(String validCharacters) Set a custom list of valid characters for this text boxMethods inherited from class heronarts.glx.ui.component.UIInputBox
decrementValue, disableImmediateAppend, disableImmediateEdit, disableReturnKeyEdit, edit, edit, editAppend, enableImmediateAppend, enableImmediateEdit, enableReturnKeyEdit, getEditBuffer, getEditRange, getFillWidthNormalized, incrementMouseValue, incrementValue, 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
getContextActions, 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, drawBorder, 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
-
UITextBox
public UITextBox() -
UITextBox
public UITextBox(float w, float h) -
UITextBox
public UITextBox(float x, float y, float w, float h) -
UITextBox
-
UITextBox
-
-
Method Details
-
getParameter
- Specified by:
getParameter
in classUIParameterComponent
-
setParameter
-
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
-
getValue
-
getValueString
- Specified by:
getValueString
in classUIInputBox
-
getInitialEditBufferValue
- Overrides:
getInitialEditBufferValue
in classUIInputBox
-
setEmptyValueAllowed
-
setValue
-
setValue
-
onValueChange
Subclasses may override to handle value changes- Parameters:
value
- New value being set
-
saveEditBuffer
- Specified by:
saveEditBuffer
in classUIInputBox
-
setValidCharacters
Set a custom list of valid characters for this text box- Parameters:
validCharacters
- Valid characters- Returns:
- this
-
isValidTextCharacter
public static boolean isValidTextCharacter(char keyChar) -
isValidCharacter
public boolean isValidCharacter(char keyChar) - Specified by:
isValidCharacter
in classUIInputBox
-
onMousePressed
Description copied from class:UIEventHandler
Subclasses override to receive mouse events- Overrides:
onMousePressed
in classUIInputBox
- Parameters:
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinate
-
focusKeyPress
Gives the text box focus and processes the key event which just occurred which would give it focus- Parameters:
keyEvent
- Key EventkeyChar
- Key characterkeyCode
- Key code
-
onCopy
-
onPaste
-
dispose
public void dispose()
-