|
|||||||||
| 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.TextEditor
public class TextEditor
A multiline text-editing widget.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.opengl.gui.EditableTextComponent |
|---|
EditableTextComponent.CompoundType |
| Field Summary | |
|---|---|
protected Point |
_curs
A mutable Point containing the inset coordiantes of the cursor. |
protected Text[] |
_glyphs
Our lines of text. |
protected int |
_lines
The number of lines of glyphs we have, or 1. |
protected Point |
_sel
A mutable Point containing the inset coordinates of the end of selection. |
| 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 | |
|---|---|
TextEditor(GlContext ctx)
Constructor. |
|
TextEditor(GlContext ctx,
String text)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
calculatePosition(int pos,
Point loc)
Calculate the inset coordinates of the specified position, populating the specified point. |
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 |
recreateGlyphs()
Recreates the entity that we use to render our text. |
protected void |
renderComponent(Renderer renderer)
Renders any custom bits for this component. |
protected void |
selectionWasSet()
Update any internal positions after the selection is set. |
| Methods inherited from class com.threerings.opengl.gui.EditableTextComponent |
|---|
acceptsFocus, deleteSelectedText, dispatchEvent, gainedFocus, getDisplayText, getDocument, getSelectedText, getSelectionBackground, getText, insertChar, layout, lostFocus, nextUndoId, renderCursor, replaceSelectedText, selectionContains, selectionIsEmpty, setCursorPos, setDocument, setMaxLength, setPlaceholder, setPreferredWidth, setSelection, setText, showCursor, stateDidChange, textInserted, textRemoved, updateFromStyleConfig, usePlaceholder, validatePaste, 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 _lines
protected Point _curs
protected Point _sel
| Constructor Detail |
|---|
public TextEditor(GlContext ctx)
public TextEditor(GlContext ctx,
String text)
| 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 void recreateGlyphs()
EditableTextComponent
recreateGlyphs 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
protected void calculatePosition(int pos,
Point loc)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||