public abstract class UIInputBox extends UIParameterComponent implements UIFocus
Modifier and Type | Class and Description |
---|---|
static class |
UIInputBox.FillStyle |
static interface |
UIInputBox.ProgressIndicator |
UIContextActions.Action
Modifier and Type | Field and Description |
---|---|
protected boolean |
editable |
protected String |
editBuffer |
protected boolean |
editing |
protected boolean |
enabled |
protected int |
fillColor |
protected UIInputBox.FillStyle |
fillStyle |
protected boolean |
hasFill |
protected UIInputBox.FillStyle |
progressFillStyle |
protected boolean |
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 |
UIInputBox() |
protected |
UIInputBox(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.
|
void |
edit() |
UIInputBox |
enableImmediateEdit(boolean immediateEdit) |
UIInputBox |
enableMousePressEdit(boolean mousePressEdit) |
UIInputBox |
enableReturnKeyEdit(boolean returnKeyEdit) |
protected String |
getEditBufferValue() |
protected double |
getFillWidthNormalized() |
protected abstract String |
getValueString() |
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.
|
boolean |
isEditable() |
boolean |
isEnabled() |
protected abstract boolean |
isValidCharacter(char keyChar) |
protected void |
onBlur()
Subclasses override when element loses focus
|
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 |
onMouseDragged(MouseEvent mouseEvent,
float mx,
float my,
float dx,
float dy)
Subclasses override to receive mouse 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
|
protected abstract void |
saveEditBuffer() |
UIInputBox |
setEditable(boolean editable) |
UIInputBox |
setEnabled(boolean enabled) |
UIInputBox |
setProgressColor(boolean hasProgressColor) |
UIInputBox |
setProgressColor(int progressColor) |
UIInputBox |
setProgressFillStyle(UIInputBox.FillStyle progressFillStyle) |
UIInputBox |
setProgressIndicator(UIInputBox.ProgressIndicator meter) |
protected void |
setValueCommand(double value) |
getContextActions, getOscAddress, getParameter, setNormalizedCommand, setUseCommandEngine
addToContainer, addToContainer, breakTextToWidth, clipTextToWidth, contains, drawBackground, drawBorder, drawFocus, drawFocusCorners, drawFocusCorners, getBackgroundColor, getBorderColor, getBorderRounding, getBorderWeight, getContainer, getFocusColor, 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, getDescription, getFocusedChild, getLX, getUI, hasDirectFocus, hasFocus, isVisible, keyEventConsumed, loop, mousePressConsumed, onFocus, onUIResize, removeLoopTask, toggleVisible
onKeyReleased, onKeyTyped, onMouseClicked, onMouseMoved, onMouseOut, onMouseOver, onMouseWheel
protected boolean enabled
protected boolean editable
protected boolean editing
protected String editBuffer
protected boolean hasFill
protected int fillColor
protected boolean returnKeyEdit
protected UIInputBox.FillStyle fillStyle
protected UIInputBox.FillStyle progressFillStyle
protected UIInputBox()
protected UIInputBox(float x, float y, float w, float h)
public UIInputBox setProgressColor(boolean hasProgressColor)
public UIInputBox setProgressColor(int progressColor)
public UIInputBox setProgressFillStyle(UIInputBox.FillStyle progressFillStyle)
public UIInputBox setProgressIndicator(UIInputBox.ProgressIndicator meter)
public UIInputBox enableReturnKeyEdit(boolean returnKeyEdit)
public UIInputBox enableImmediateEdit(boolean immediateEdit)
public UIInputBox enableMousePressEdit(boolean mousePressEdit)
protected abstract String getValueString()
protected abstract void saveEditBuffer()
public boolean isEditable()
public UIInputBox setEditable(boolean editable)
public boolean isEnabled()
public UIInputBox setEnabled(boolean enabled)
public void edit()
protected String getEditBufferValue()
protected void onBlur()
UIObject
protected double getFillWidthNormalized()
protected void onDraw(UI ui, PGraphics pg)
UIObject
protected abstract boolean isValidCharacter(char keyChar)
protected void decrementValue(KeyEvent keyEvent)
keyEvent
- Key eventprotected void incrementValue(KeyEvent keyEvent)
keyEvent
- Key eventprotected void onKeyPressed(KeyEvent keyEvent, char keyChar, int keyCode)
UIEventHandler
onKeyPressed
in class UIEventHandler
keyEvent
- Key eventkeyChar
- Key characterkeyCode
- Key code valueprotected void incrementMouseValue(MouseEvent mouseEvent, int offset)
mouseEvent
- Mouse eventoffset
- Units of mouse movement, positive or negativeprotected void setValueCommand(double value)
protected void onMousePressed(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMousePressed
in class UIParameterComponent
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onMouseReleased(MouseEvent mouseEvent, float mx, float my)
UIEventHandler
onMouseReleased
in class UIParameterComponent
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinateprotected void onMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy)
UIEventHandler
onMouseDragged
in class UIEventHandler
mouseEvent
- Mouse eventmx
- x-coordinatemy
- y-coordinatedx
- movement in xdy
- movement in yLX library by Mark C. Slee. © 2012-2020