|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.WidgetBase
org.xith3d.ui.hud.base.RectangularWidget
org.xith3d.ui.hud.widgets.Label
org.xith3d.ui.hud.widgets.TextField
public class TextField
A TextField is a Widget that allows for editing a single line of text.
| Nested Class Summary | |
|---|---|
static class |
TextField.Description
|
| Nested classes/interfaces inherited from interface org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.widgets.Label |
|---|
autoSize |
| Fields inherited from class org.xith3d.ui.hud.base.WidgetBase |
|---|
containerListeners, transformGroup, translation, Z_INDEX_UNIT, Z_INDEX_UNIT_ASSEMBLER |
| Constructor Summary | |
|---|---|
TextField(float width,
float height)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(float width,
float height,
int zIndex)
Creates a new TextField with the given width, height and z-index and no text initially. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width, height and z-index. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and z-index. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width, height and z-index. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width, height and z-index. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
TextAlignment alignment)
Creates a new TextField with the given width and height and z-index. |
|
TextField(float width,
float height,
int zIndex,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new Label with the given width, height and z-index. |
|
TextField(float width,
float height,
java.lang.String text)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
java.awt.Font font)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(float width,
float height,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new TextField with the given width, height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
Creates a new TextField with the given width, height and z-index and no text initially. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width, height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width, height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width, height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextAlignment alignment)
Creates a new TextField with the given width and height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new TextField with the given width, height and z-index. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
TextAlignment alignment)
Creates a new TextField with the given width and height and a z-index of 0. |
|
TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new TextField with the given width, height and a z-index of 0. |
|
| Method Summary | |
|---|---|
void |
addTextFieldListener(TextFieldListener l)
Adds a listener, that is notified of special TextField events. |
protected void |
fixTranslation(org.openmali.vecmath2.Tuple2f offset)
|
Border |
getBorder()
|
int |
getCaretPosition()
|
java.lang.String |
getDisplayedText()
|
char |
getEchoChar()
|
char[] |
getIgnoredChars()
|
float |
getPaddingBottom()
|
float |
getPaddingLeft()
|
float |
getPaddingRight()
|
float |
getPaddingTop()
|
float |
getTransparency()
|
protected void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isEchoMode()
|
boolean |
isEditable()
|
void |
onDetached()
This method is called right before the Widget has been detached from its WidgetContainer. |
void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
This event is fired, when a key is released on a focused Widget. |
void |
onKeyTyped(char ch,
long when)
This event is fired when a key is typed on the keyboard. |
void |
removeTextFieldListener(TextFieldListener l)
Removes a TextFieldListener from the list. |
void |
setBorder(Border.Description borderDesc)
Creates a new Border from the given Border.Desctiption and invokes setBorder(Border). |
void |
setBorder(Border border)
Sets the Border to use for this BorderSettable Widget. |
void |
setCaretPosition(int pos)
|
void |
setEchoChar(char echoChar)
Sets the character to replace each character of the TextField's text with when in echo-mode. |
void |
setEchoMode(boolean echoMode)
Enables/Disables the echo-mode. |
void |
setEchoMode(boolean echoMode,
char echoChar)
Enables/Disables the echo-mode. |
void |
setEditable(boolean editable)
Enables or disables the editability of this TextField. |
void |
setFont(java.awt.Font font)
Sets the new Font to be used |
void |
setFontColor(org.openmali.vecmath2.Colorf color)
Sets the new color to be used |
void |
setIgnoredChars(char... ignoredChars)
Sets the array of chars ignored by this TextField. |
boolean |
setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
Sets padding for this PaddingSettable Widget. |
boolean |
setSize(float width,
float height,
boolean forced)
|
void |
setText(java.lang.String text)
Sets the new text to be displayed |
void |
setTransparency(float transparency)
Sets the whole Widget's Transparency. |
void |
update()
Updates the Widget's internals. |
protected void |
updateText()
|
void |
updateTranslation()
Effectively changes the translation of this Widget (location and z-index) |
| Methods inherited from class org.xith3d.ui.hud.widgets.Label |
|---|
getAlignment, getBackground, getBackgroundColor, getBackgroundTileHeight, getBackgroundTileSize, getBackgroundTileWidth, getContentGroup, getFont, getFont, getFontColor, getFontColor, getFontColorDisabled, getFontDisabled, getMinimalSize, getText, getTextRectangle, isAutoSizeEnabled, isEnabled, setAlignment, setAutoSizeEnabled, setBackground, setBackground, setBackground, setBackgroundTileSize, setBackgroundTileSize, setContainer, setEnabled, setEnabledImpl, setFontColorDisabled, setFontDisabled, setMinimalSize, setPadding, toString |
| Methods inherited from class org.xith3d.ui.hud.base.RectangularWidget |
|---|
getPickHeight, getPickSGZPosition, getPickWidth, pick |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openmali.types.twodee.Sized2f |
|---|
setHeight, setWidth |
| Constructor Detail |
|---|
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
TextField.Description textFieldDesc)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgettextFieldDesc - a LabelDescription instance holding information
about font, color, alignment and background-texture
public TextField(float width,
float height,
java.lang.String text,
TextField.Description textFieldDesc)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgettextFieldDesc - a LabelDescription instance holding information
about font, color, alignment and background-texture
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextField.Description textFieldDesc)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgettextFieldDesc - a TextField.Description instance holding information
about font, color, alignment and background-texture
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
TextField.Description textFieldDesc)
size - the new size of this Widgettext - the text to display in this TextWidgettextFieldDesc - a LabelDescription instance holding information
about font, color, alignment and background-texture
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
java.lang.String text,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be usedalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textcolor - the color to be used
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
size - the new size of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public TextField(float width,
float height,
int zIndex,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
size - the new size of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public TextField(float width,
float height,
java.lang.String text,
org.openmali.vecmath2.Colorf color)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetcolor - the color to be used
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the text
public TextField(float width,
float height,
java.lang.String text,
java.awt.Font font)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the text
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
size - the new size of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textalignment - the horizontal and vertical alignment
public TextField(float width,
float height,
java.lang.String text,
java.awt.Font font,
TextAlignment alignment)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidgetfont - the Font to be used for the textalignment - the horizontal and vertical alignment
public TextField(org.openmali.types.twodee.Sized2fRO size,
int zIndex)
size - the new size of this WidgetzIndex - the z-index of this Widget
public TextField(float width,
float height,
int zIndex)
width - the new width of this Widgetheight - the new height of this WidgetzIndex - the z-index of this Widgetpublic TextField(org.openmali.types.twodee.Sized2fRO size)
size - the new size of this Widget
public TextField(float width,
float height)
width - the new width of this Widgetheight - the new height of this Widget
public TextField(org.openmali.types.twodee.Sized2fRO size,
java.lang.String text)
size - the new size of this Widgettext - the text to display in this TextWidget
public TextField(float width,
float height,
java.lang.String text)
width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidget| Method Detail |
|---|
public final void addTextFieldListener(TextFieldListener l)
l - public final void removeTextFieldListener(TextFieldListener l)
l - public void setTransparency(float transparency)
setTransparency in interface WidgetsetTransparency in class Labelpublic float getTransparency()
getTransparency in interface WidgetgetTransparency in class Labelpublic void setEditable(boolean editable)
editable - public boolean isEditable()
public void setBorder(Border border)
setBorder in interface BorderSettableborder - the new Border (null for no border)public void setBorder(Border.Description borderDesc)
setBorder in interface BorderSettableborderDesc - the Border.Description to create the new Border from (null for no border)BorderSettable.setBorder(Border)public final Border getBorder()
getBorder in interface BorderSettable
public boolean setPadding(float paddingBottom,
float paddingRight,
float paddingTop,
float paddingLeft)
setPadding in interface PaddingSettablesetPadding in class Labelpublic float getPaddingBottom()
getPaddingBottom in interface PaddingSettablegetPaddingBottom in class Labelpublic float getPaddingRight()
getPaddingRight in interface PaddingSettablegetPaddingRight in class Labelpublic float getPaddingTop()
getPaddingTop in interface PaddingSettablegetPaddingTop in class Labelpublic float getPaddingLeft()
getPaddingLeft in interface PaddingSettablegetPaddingLeft in class Labelpublic void setCaretPosition(int pos)
public int getCaretPosition()
public void setEchoChar(char echoChar)
echoChar - public char getEchoChar()
public void setEchoMode(boolean echoMode,
char echoChar)
echoMode - echoChar - public void setEchoMode(boolean echoMode)
echoMode - public boolean isEchoMode()
public void setIgnoredChars(char... ignoredChars)
ignoredChars - public char[] getIgnoredChars()
public java.lang.String getDisplayedText()
getDisplayedText in class Labelprotected void updateText()
updateText in class Labelpublic void setText(java.lang.String text)
setText in interface TextWidgetsetText in class Labeltext - the new Textpublic void setFontColor(org.openmali.vecmath2.Colorf color)
setFontColor in interface TextWidgetsetFontColor in class Labelcolor - the new colorpublic void setFont(java.awt.Font font)
setFont in interface TextWidgetsetFont in class Labelfont - the new Font
public void onKeyReleased(org.jagatoo.input.devices.components.Key key,
long when)
onKeyReleased in interface WidgetonKeyReleased in class WidgetBasekey - the key that was releasedwhen - the keyevent's timestamp
public void onKeyTyped(char ch,
long when)
onKeyTyped in interface WidgetonKeyTyped in class WidgetBasech - the typed key's characterwhen - the keyevent's timestamp
public boolean setSize(float width,
float height,
boolean forced)
setSize in class Labelprotected void fixTranslation(org.openmali.vecmath2.Tuple2f offset)
fixTranslation in class Labelpublic void update()
update in interface Widgetupdate in class WidgetBasepublic void updateTranslation()
updateTranslation in class Labelpublic void onDetached()
onDetached in interface WidgetonDetached in class WidgetBaseprotected void init()
init in class Label
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||