Package com.ardor3d.extension.ui
Class AbstractUITextEntryComponent
java.lang.Object
com.ardor3d.scenegraph.Spatial
com.ardor3d.scenegraph.Node
com.ardor3d.extension.ui.UIComponent
com.ardor3d.extension.ui.StateBasedUIComponent
com.ardor3d.extension.ui.AbstractUITextEntryComponent
- All Implemented Interfaces:
UIKeyHandler
,Textable
,Hintable
,Savable
- Direct Known Subclasses:
UITextArea
,UITextField
public abstract class AbstractUITextEntryComponent
extends StateBasedUIComponent
implements Textable
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Alignment
Alignment value to use to position the icon/text within the overall dimensions of this component.protected TextCaret
protected int
protected boolean
protected UIState
protected UIState
protected boolean
protected TextSelection
protected boolean
If true, our text could be marked up with style information.protected RenderedText
The text object to use for drawing label text.protected UIState
Fields inherited from class com.ardor3d.extension.ui.UIComponent
_tooltipPopTime, _tooltipText, DEFAULT_FOREGROUND_COLOR
Fields inherited from class com.ardor3d.scenegraph.Spatial
_controllers, _delegateMap, _dirtyMark, _frustumIntersects, _listener, _localTransform, _name, _parent, _queueDistance, _renderStateList, _sceneHints, _userData, _worldBound, _worldTransform, ON_DIRTY_ATTACHED, ON_DIRTY_BOUNDING, ON_DIRTY_RENDERSTATE, ON_DIRTY_TRANSFORM, ON_DIRTY_TRANSFORM_ONLY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Let subcomponents know that style has been changed.getCaret()
int
protected abstract UIKeyHandler
int
getText()
boolean
boolean
boolean
void
setAlignment
(Alignment alignment) int
setCaretPosition
(int index) Set the position of the text caret as an index to the current set text string.void
setCopyable
(boolean copyable) void
setEditable
(boolean editable) void
setStyledText
(boolean value) void
Set the text for this component.void
Ask this component to update its minimum allowed size, based on its contents.Methods inherited from class com.ardor3d.extension.ui.StateBasedUIComponent
gainedFocus, getCurrentState, keyHeld, keyPressed, keyReleased, lostFocus, mouseDeparted, mouseEntered, mouseMoved, mousePressed, mouseReleased, mouseWheel, refreshState, setEnabled, setForegroundColor, switchState
Methods inherited from class com.ardor3d.extension.ui.UIComponent
addFontStyle, applySkin, attachedToHud, cancelTooltipTimer, centerOn, centerOn, clearFontStyle, clearMaximumContentSize, clearMinimumContentSize, compact, detachedFromHud, draw, drawComponent, fireComponentDirty, fitComponentIn, getBackdrop, getBorder, getCombinedOpacity, getContentHeight, getContentWidth, getCurrentOpacity, getDefaultFontFamily, getDefaultFontSize, getDefaultFontStyles, getFontStyles, getForegroundColor, getHud, getHudX, getHudY, getKeyFocusTarget, getLayoutData, getLocalComponentHeight, getLocalComponentWidth, getLocalFontStyles, getLocalForegroundColor, getLocalOpacity, getLocalX, getLocalY, getMargin, getMaximumContentHeight, getMaximumContentWidth, getMaximumLocalComponentHeight, getMaximumLocalComponentWidth, getMinimumContentHeight, getMinimumContentWidth, getMinimumLocalComponentHeight, getMinimumLocalComponentWidth, getPadding, getRelativeComponentBounds, getRelativeMaxComponentBounds, getRelativeMinComponentBounds, getTooltipPopTime, getTooltipText, getTopLevelComponent, getTotalBottom, getTotalLeft, getTotalRight, getTotalTop, getUIComponent, hasVirginContentArea, insideMargin, isAttachedToHUD, isConsumeKeyEvents, isConsumeMouseEvents, isEnabled, isUseTransparency, isVisible, layout, mouseClicked, pack, postdrawComponent, predrawComponent, requestFocus, setBackdrop, setBorder, setConsumeKeyEvents, setConsumeMouseEvents, setContentHeight, setContentSize, setContentWidth, setDefaultFontFamily, setDefaultFontSize, setDefaultFontStyles, setFontStyles, setForegroundColor, setHudX, setHudXY, setHudY, setKeyFocusTarget, setLayoutData, setLayoutMinimumContentSize, setLocalComponentHeight, setLocalComponentSize, setLocalComponentWidth, setLocalX, setLocalXY, setLocalY, setMargin, setMaximumContentHeight, setMaximumContentSize, setMaximumContentWidth, setMinimumContentHeight, setMinimumContentSize, setMinimumContentWidth, setOpacity, setPadding, setTooltipPopTime, setTooltipText, setUseTransparency, setVirginContentArea, setVisible, updateWorldTransform, updateWorldTransform, validateContentSize
Methods inherited from class com.ardor3d.scenegraph.Node
acceptVisitor, attachChild, attachChildAt, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getClassTag, getNumberOfChildren, hasChild, makeCopy, makeInstanced, propagateDirtyDown, read, sortLights, swapChildren, updateChildren, updateWorldBound, updateWorldRenderStates, write
Methods inherited from class com.ardor3d.scenegraph.Spatial
addController, addTranslation, addTranslation, applyWorldRenderStates, clearControllers, clearDirty, clearDirty, clearRenderState, getController, getControllerCount, getControllers, getCurrentRenderDelegate, getLastFrustumIntersection, getListener, getLocalLastFrustumIntersection, getLocalRenderState, getLocalRenderStates, getName, getParent, getParentHintable, getRenderDelegate, getRotation, getScale, getSceneHints, getTransform, getTranslation, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, isDirty, localToWorld, markDirty, markDirty, onDraw, propagateBoundToRoot, propagateDirtyUp, propagateStatesFromRoot, propageEventUp, removeController, removeController, removeFromParent, setLastFrustumIntersection, setListener, setName, setParent, setRenderDelegate, setRenderState, setRotation, setRotation, setScale, setScale, setScale, setTransform, setTranslation, setTranslation, setUserData, setWorldRotation, setWorldRotation, setWorldScale, setWorldScale, setWorldScale, setWorldTransform, setWorldTranslation, setWorldTranslation, toString, updateControllers, updateGeometricState, updateGeometricState, updateWorldRenderStates, worldToLocal
-
Field Details
-
_caretPosition
protected int _caretPosition -
_editable
protected boolean _editable -
_copyable
protected boolean _copyable -
_disabledState
-
_defaultState
-
_writingState
-
_uiText
The text object to use for drawing label text. -
_styled
protected boolean _styledIf true, our text could be marked up with style information. -
_alignment
Alignment value to use to position the icon/text within the overall dimensions of this component. -
_caret
-
_selection
-
-
Constructor Details
-
AbstractUITextEntryComponent
public AbstractUITextEntryComponent()
-
-
Method Details
-
getKeyHandler
-
getDefaultState
- Specified by:
getDefaultState
in classStateBasedUIComponent
- Returns:
- the state that represents the default appearance and behavior for this component.
-
getDisabledState
- Specified by:
getDisabledState
in classStateBasedUIComponent
- Returns:
- the state that represents the disabled appearance and behavior for this component.
-
getWritingState
-
getText
-
setText
Set the text for this component. Also updates the minimum size of the component. -
isStyledText
public boolean isStyledText()- Specified by:
isStyledText
in interfaceTextable
-
setStyledText
public void setStyledText(boolean value) - Specified by:
setStyledText
in interfaceTextable
-
isCopyable
public boolean isCopyable() -
setCopyable
public void setCopyable(boolean copyable) -
setCaretPosition
public int setCaretPosition(int index) Set the position of the text caret as an index to the current set text string. If the specified position is after the last possible index, it is set to the last possible index.- Parameters:
index
- the new position- Returns:
- the new caret position
-
getCaretPosition
public int getCaretPosition() -
getSelectionLength
public int getSelectionLength() -
clearSelection
public void clearSelection() -
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean editable) - Parameters:
editable
- true if the text of this component can be changed by keyboard interaction
-
getCaret
-
getSelection
-
getAlignment
-
setAlignment
-
fireStyleChanged
public void fireStyleChanged()Description copied from class:UIComponent
Let subcomponents know that style has been changed.- Overrides:
fireStyleChanged
in classUIComponent
-
updateMinimumSizeFromContents
public void updateMinimumSizeFromContents()Description copied from class:UIComponent
Ask this component to update its minimum allowed size, based on its contents.- Overrides:
updateMinimumSizeFromContents
in classUIComponent
-
getStates
- Specified by:
getStates
in classStateBasedUIComponent
- Returns:
- an ImmutableSet of possible states for this component.
-