|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.TextComponent
com.threerings.opengl.gui.EditableTextComponent
com.threerings.opengl.gui.TextField
public class TextField
Displays and allows for the editing of a single line of text.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.EditableTextComponent |
|---|
EditableTextComponent.CompoundType |
| Field Summary | |
|---|---|
protected int |
_cursx
|
protected Text |
_glyphs
Our text glyphs. |
protected int |
_selx
|
protected int |
_txoff
|
| Fields inherited from class com.threerings.opengl.gui.EditableTextComponent |
|---|
_cursp, _keymap, _lastCompoundType, _lastUndoId, _placeholder, _prefWidth, _selectionBackgrounds, _selp, _showCursor, _srect, _text, _undomgr |
| Fields inherited from class com.threerings.opengl.gui.TextComponent |
|---|
_effcols, _effsizes, _haligns, _lineSpacings, _teffects, _textfacts, _valigns |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.threerings.opengl.gui.text.EditCommands |
|---|
ACTION, BACKSPACE, CLEAR, COPY, CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT, CURSOR_UP, CUT, DELETE, END_OF_LINE, PASTE, REDO, RELEASE_FOCUS, START_OF_LINE, UNDO, WORD_LEFT, WORD_RIGHT |
| Constructor Summary | |
|---|---|
TextField(GlContext ctx)
Creates a blank text field. |
|
TextField(GlContext ctx,
int maxLength)
Creates a blank text field with maximum input length. |
|
TextField(GlContext ctx,
String text)
Creates a text field with the specified starting text. |
|
TextField(GlContext ctx,
String text,
int maxLength)
Creates a text field with the specified starting text and max length. |
|
| Method Summary | |
|---|---|
protected void |
clearGlyphs()
Clears out our text textures and other related bits. |
protected Dimension |
computePreferredSize(int whint,
int hhint)
Computes and returns a preferred size for this component. |
protected void |
createGlyphs()
Create the entity that we use to render our text. |
protected String |
getDefaultStyleConfig()
Returns the name of the default config to be used for all instances of this component. |
protected int |
getPosition(int mouseX,
int mouseY)
Get the position in our document, given the mouse local mouse coordinates that have already had the insets taken into account. |
protected boolean |
hasGlyphs()
Do we have glyphs computed? |
protected boolean |
processCommand(int cmd)
Process the specified edit command, returning true if it was handled. |
protected void |
renderComponent(Renderer renderer)
Renders any custom bits for this component. |
protected void |
selectionWasSet()
Update any internal positions after the selection is set. |
protected String |
validatePaste(String pasted)
Validate the pasted text. |
| Methods inherited from class com.threerings.opengl.gui.EditableTextComponent |
|---|
acceptsFocus, deleteSelectedText, dispatchEvent, gainedFocus, getDisplayText, getDocument, getSelectedText, getSelectionBackground, getText, insertChar, layout, lostFocus, nextUndoId, recreateGlyphs, renderCursor, replaceSelectedText, selectionContains, selectionIsEmpty, setCursorPos, setDocument, setMaxLength, setPlaceholder, setPreferredWidth, setSelection, setText, showCursor, stateDidChange, textInserted, textRemoved, updateFromStyleConfig, usePlaceholder, wasAdded, wasRemoved |
| Methods inherited from class com.threerings.opengl.gui.TextComponent |
|---|
getEffectColor, getEffectSize, getHorizontalAlignment, getLabelRendererConfig, getLineSpacing, getTextEffect, getTextFactory, getTextFactory, getVerticalAlignment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Text _glyphs
protected int _cursx
protected int _selx
protected int _txoff
| Constructor Detail |
|---|
public TextField(GlContext ctx)
public TextField(GlContext ctx,
int maxLength)
LengthLimitedDocument, changing the
document will remove the length control.
public TextField(GlContext ctx,
String text)
public TextField(GlContext ctx,
String text,
int maxLength)
LengthLimitedDocument, changing the document will remove the length
control.
| Method Detail |
|---|
protected String getDefaultStyleConfig()
Component
getDefaultStyleConfig in class Componentprotected void renderComponent(Renderer renderer)
Component
renderComponent in class Component
protected Dimension computePreferredSize(int whint,
int hhint)
Component
computePreferredSize in class Componentprotected boolean processCommand(int cmd)
EditableTextComponent
processCommand in class EditableTextComponentprotected String validatePaste(String pasted)
EditableTextComponent
validatePaste in class EditableTextComponentprotected boolean hasGlyphs()
EditableTextComponent
hasGlyphs in class EditableTextComponentprotected void createGlyphs()
EditableTextComponent
createGlyphs in class EditableTextComponentprotected void clearGlyphs()
EditableTextComponent
clearGlyphs in class EditableTextComponent
protected int getPosition(int mouseX,
int mouseY)
EditableTextComponent
getPosition in class EditableTextComponentprotected void selectionWasSet()
EditableTextComponent
selectionWasSet in class EditableTextComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||