Package com.simsilica.lemur.component
Class TextEntryComponent
java.lang.Object
com.simsilica.lemur.component.AbstractGuiComponent
com.simsilica.lemur.component.TextEntryComponent
- All Implemented Interfaces:
ColoredComponent,GuiComponent,FocusTarget
public class TextEntryComponent
extends AbstractGuiComponent
implements FocusTarget, ColoredComponent
A basic text entry component that allows displaying and editing of
text based on a DocumentModel. Default key bindings are setup for
common navigation functions and the key input is taken over while the
component has focus.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListenerstatic final KeyActionListener -
Constructor Summary
ConstructorsConstructorDescriptionTextEntryComponent(BitmapFont font) TextEntryComponent(DocumentModel model, BitmapFont font) -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(GuiControl parent) voidclone()voiddetach(GuiControl parent) voidNotifies this focus target that is has gained focus.voidNotifies this focus target that is has lost focus.floatgetAlpha()Returns the current alpha multiplier that is applied to the color when set to the actual visuals.getColor()Returns the current color of this component.floatgetFont()floatfloatfloatgetText()protected floatgetVisibleWidth(String text) booleanReturns true if this target can currently accept focus through a normal transition.booleanReturns true if this focus target currently has the focus.booleanprotected voidprotected voidprotected voidprotected voidprotected voidvoidprotected voidvoidsetAlpha(float f) Sets an alpha multiplier that will be applied to the color when set to the actual visuals.voidSets the color for this component.voidsetFont(BitmapFont font) voidsetFontSize(float f) voidvoidvoidsetPreferredLineCount(int i) voidvoidsetPreferredWidth(float f) voidsetSingleLine(boolean f) voidvoidMethods inherited from class com.simsilica.lemur.component.AbstractGuiComponent
getGuiControl, getNode, invalidate, isAttached
-
Field Details
-
DOC_HOME
-
DOC_END
-
LINE_HOME
-
LINE_END
-
PREV_LINE
-
NEXT_LINE
-
LEFT
-
RIGHT
-
NO_OP
-
BACKSPACE
-
NEW_LINE
-
DELETE
-
RELEASE_FOCUS
-
FOCUS_NEXT
-
FOCUS_PREVIOUS
-
FOCUS_DOWN
-
FOCUS_UP
-
-
Constructor Details
-
TextEntryComponent
-
TextEntryComponent
-
-
Method Details
-
clone
- Specified by:
clonein interfaceGuiComponent- Overrides:
clonein classAbstractGuiComponent
-
attach
- Specified by:
attachin interfaceGuiComponent- Overrides:
attachin classAbstractGuiComponent
-
detach
- Specified by:
detachin interfaceGuiComponent- Overrides:
detachin classAbstractGuiComponent
-
isFocused
public boolean isFocused()Description copied from interface:FocusTargetReturns true if this focus target currently has the focus.- Specified by:
isFocusedin interfaceFocusTarget
-
isFocusable
public boolean isFocusable()Description copied from interface:FocusTargetReturns true if this target can currently accept focus through a normal transition. If an attempt is made to force the focus to this target then focus may actually transition to a different target.- Specified by:
isFocusablein interfaceFocusTarget
-
focusGained
public void focusGained()Description copied from interface:FocusTargetNotifies this focus target that is has gained focus.- Specified by:
focusGainedin interfaceFocusTarget
-
focusLost
public void focusLost()Description copied from interface:FocusTargetNotifies this focus target that is has lost focus.- Specified by:
focusLostin interfaceFocusTarget
-
getActionMap
-
getDocumentModel
-
setSingleLine
public void setSingleLine(boolean f) -
isSingleLine
public boolean isSingleLine() -
setFont
-
getFont
-
setFontSize
public void setFontSize(float f) -
getFontSize
public float getFontSize() -
resetCursorColor
protected void resetCursorColor() -
setColor
Description copied from interface:ColoredComponentSets the color for this component.- Specified by:
setColorin interfaceColoredComponent
-
getColor
Description copied from interface:ColoredComponentReturns the current color of this component.- Specified by:
getColorin interfaceColoredComponent
-
setAlpha
public void setAlpha(float f) Description copied from interface:ColoredComponentSets an alpha multiplier that will be applied to the color when set to the actual visuals.- Specified by:
setAlphain interfaceColoredComponent
-
getAlpha
public float getAlpha()Description copied from interface:ColoredComponentReturns the current alpha multiplier that is applied to the color when set to the actual visuals.- Specified by:
getAlphain interfaceColoredComponent
-
resetText
protected void resetText() -
getVisibleWidth
-
setPreferredCursorWidth
-
getPreferredCursorWidth
-
getCursorWidth
public float getCursorWidth() -
resizeCursor
protected void resizeCursor() -
resetCursorState
protected void resetCursorState() -
resetCursorPosition
protected void resetCursorPosition() -
setText
-
getText
-
setHAlignment
-
getHAlignment
-
setVAlignment
-
getVAlignment
-
setPreferredSize
-
getPreferredSize
-
setPreferredWidth
public void setPreferredWidth(float f) -
getPreferredWidth
public float getPreferredWidth() -
setPreferredLineCount
public void setPreferredLineCount(int i) -
getPreferredLineCount
public float getPreferredLineCount() -
reshape
- Specified by:
reshapein interfaceGuiComponent
-
calculatePreferredSize
- Specified by:
calculatePreferredSizein interfaceGuiComponent
-
resetAlignment
protected void resetAlignment()
-