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 Details

  • Constructor Details

  • Method Details

    • clone

      public TextEntryComponent clone()
      Specified by:
      clone in interface GuiComponent
      Overrides:
      clone in class AbstractGuiComponent
    • attach

      public void attach(GuiControl parent)
      Specified by:
      attach in interface GuiComponent
      Overrides:
      attach in class AbstractGuiComponent
    • detach

      public void detach(GuiControl parent)
      Specified by:
      detach in interface GuiComponent
      Overrides:
      detach in class AbstractGuiComponent
    • isFocused

      public boolean isFocused()
      Description copied from interface: FocusTarget
      Returns true if this focus target currently has the focus.
      Specified by:
      isFocused in interface FocusTarget
    • isFocusable

      public boolean isFocusable()
      Description copied from interface: FocusTarget
      Returns 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:
      isFocusable in interface FocusTarget
    • focusGained

      public void focusGained()
      Description copied from interface: FocusTarget
      Notifies this focus target that is has gained focus.
      Specified by:
      focusGained in interface FocusTarget
    • focusLost

      public void focusLost()
      Description copied from interface: FocusTarget
      Notifies this focus target that is has lost focus.
      Specified by:
      focusLost in interface FocusTarget
    • getActionMap

      public Map<KeyAction,KeyActionListener> getActionMap()
    • getDocumentModel

      public DocumentModel getDocumentModel()
    • setSingleLine

      public void setSingleLine(boolean f)
    • isSingleLine

      public boolean isSingleLine()
    • setFont

      public void setFont(BitmapFont font)
    • getFont

      public BitmapFont getFont()
    • setFontSize

      public void setFontSize(float f)
    • getFontSize

      public float getFontSize()
    • resetCursorColor

      protected void resetCursorColor()
    • setColor

      public void setColor(ColorRGBA color)
      Description copied from interface: ColoredComponent
      Sets the color for this component.
      Specified by:
      setColor in interface ColoredComponent
    • getColor

      public ColorRGBA getColor()
      Description copied from interface: ColoredComponent
      Returns the current color of this component.
      Specified by:
      getColor in interface ColoredComponent
    • setAlpha

      public void setAlpha(float f)
      Description copied from interface: ColoredComponent
      Sets an alpha multiplier that will be applied to the color when set to the actual visuals.
      Specified by:
      setAlpha in interface ColoredComponent
    • getAlpha

      public float getAlpha()
      Description copied from interface: ColoredComponent
      Returns the current alpha multiplier that is applied to the color when set to the actual visuals.
      Specified by:
      getAlpha in interface ColoredComponent
    • resetText

      protected void resetText()
    • getVisibleWidth

      protected float getVisibleWidth(String text)
    • setPreferredCursorWidth

      public void setPreferredCursorWidth(Float f)
    • getPreferredCursorWidth

      public Float getPreferredCursorWidth()
    • getCursorWidth

      public float getCursorWidth()
    • resizeCursor

      protected void resizeCursor()
    • resetCursorState

      protected void resetCursorState()
    • resetCursorPosition

      protected void resetCursorPosition()
    • setText

      public void setText(String text)
    • getText

      public String getText()
    • setHAlignment

      public void setHAlignment(HAlignment a)
    • getHAlignment

      public HAlignment getHAlignment()
    • setVAlignment

      public void setVAlignment(VAlignment a)
    • getVAlignment

      public VAlignment getVAlignment()
    • setPreferredSize

      public void setPreferredSize(Vector3f v)
    • getPreferredSize

      public Vector3f getPreferredSize()
    • setPreferredWidth

      public void setPreferredWidth(float f)
    • getPreferredWidth

      public float getPreferredWidth()
    • setPreferredLineCount

      public void setPreferredLineCount(int i)
    • getPreferredLineCount

      public float getPreferredLineCount()
    • reshape

      public void reshape(Vector3f pos, Vector3f size)
      Specified by:
      reshape in interface GuiComponent
    • calculatePreferredSize

      public void calculatePreferredSize(Vector3f size)
      Specified by:
      calculatePreferredSize in interface GuiComponent
    • resetAlignment

      protected void resetAlignment()