|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
org.xith3d.ui.hud.base.BackgroundSettableWidget
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 class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
BackgroundSettableWidget.BackgroundSettableDescriptionBase |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.widgets.Label |
|---|
DEFAULT_HEAVYWEIGHT |
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
TextField(boolean isHeavyWeight,
float width,
float height)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(boolean isHeavyWeight,
float width,
float height,
java.lang.String text)
Creates a new TextField with the given width and height and no text initially. |
|
TextField(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
Creates a new TextField with the given width, height and z-index. |
|
TextField(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new Label with the given width, height and z-index. |
|
TextField(float width,
float height)
Creates a new TextField with the given width and height and no text initially. |
|
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,
HUDFont 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,
java.lang.String text,
TextField.Description textFieldDesc)
Creates a new Label with the given width, height and z-index. |
|
| Method Summary | |
|---|---|
void |
addTextFieldListener(TextFieldListener l)
Adds a listener, that is notified of special TextField events. |
protected boolean |
blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
Checks, if this Widget blocks the given DeviceComponent for focus-moves. |
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
int |
getCaretPosition()
|
java.lang.String |
getDisplayedText()
|
char |
getEchoChar()
|
char[] |
getIgnoredChars()
|
protected void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isEchoMode()
|
boolean |
isEditable()
|
protected void |
onAttachedToHUD(HUD hud)
This event is fired, when this Widget is added to the HUD live Widget hierarchy. |
protected void |
onDetachedFromHUD(HUD hud)
This event is fired, when this Widget is removed from the HUD live Widget hierarchy. |
protected void |
onFocusGained()
This event is fired, when the focus is gained to a Widget. |
protected void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
protected void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is pressed on a focused Widget. |
protected void |
onKeyTyped(char ch,
int modifierMask,
long when)
This event is fired when a key is typed on the keyboard. |
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
void |
removeTextFieldListener(TextFieldListener l)
Removes a TextFieldListener from the list. |
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(HUDFont font)
Sets the new Font to be used |
void |
setIgnoredChars(char... ignoredChars)
Sets the array of chars ignored by this TextField. |
void |
setText(java.lang.String text)
Sets the new text to be displayed |
protected void |
updateText()
|
| Methods inherited from class org.xith3d.ui.hud.widgets.Label |
|---|
drawIcon, drawText, getAlignment, getFont, getFont, getFontColor, getFontColor, getFontColorDisabled, getFontDisabled, getIcon, getIconGap, getMinimalHeight, getMinimalSize, getMinimalWidth, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getText, getTextOffsetX, getTextOffsetY, initSize, isAutoSizeEnabled, isEnabled, prepareText, setAlignment, setAutoSizeEnabled, setEnabled, setEnabledImpl, setFontColor, setFontColorDisabled, setFontDisabled, setIcon, setIcon, setIconGap, setMinimalSize, setPadding, setPadding, setText, setText, setTextOffset |
| Methods inherited from class org.xith3d.ui.hud.base.BackgroundSettableWidget |
|---|
drawBackground, getBackgroundColor, getBackgroundTexture, getBackgroundTileMode, setBackground, setBackground, setBackground, setBackgroundColor, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTexture, setBackgroundTileMode, setNoBackground |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextField(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
TextField.Description textFieldDesc)
isHeavyWeight - 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(boolean isHeavyWeight,
float width,
float height,
java.lang.String text,
HUDFont font,
org.openmali.vecmath2.Colorf color,
TextAlignment alignment)
isHeavyWeight - 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(boolean isHeavyWeight,
float width,
float height,
java.lang.String text)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this Widgettext - the text to display in this TextWidget
public TextField(boolean isHeavyWeight,
float width,
float height)
isHeavyWeight - width - the new width of this Widgetheight - the new height of this Widget
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(float width,
float height,
java.lang.String text,
HUDFont 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(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
public TextField(float width,
float height)
width - the new width of this Widgetheight - the new height of this Widget| Method Detail |
|---|
public void addTextFieldListener(TextFieldListener l)
l - public void removeTextFieldListener(TextFieldListener l)
l - public void setEditable(boolean editable)
editable - public boolean isEditable()
public void setCaretPosition(int pos)
public final int getCaretPosition()
public void setEchoChar(char echoChar)
echoChar - public final 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 setFont(HUDFont font)
setFont in interface TextWidgetsetFont in class Labelfont - the new Fontprotected boolean blocksFocusMoveDeviceComponent(org.jagatoo.input.devices.components.DeviceComponent dc)
blocksFocusMoveDeviceComponent in class Widget
protected void onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
onKeyPressed in class Widgetkey - the key that was pressedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onKeyTyped(char ch,
int modifierMask,
long when)
onKeyTyped in class Widgetch - the typed key's charactermodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
onSizeChanged in class Labelprotected void onFocusGained()
onFocusGained in class Widgetprotected void onFocusLost()
onFocusLost in class Widgetprotected void onAttachedToHUD(HUD hud)
onAttachedToHUD in class Labelhud - the HUD, the Widget is added toprotected void onDetachedFromHUD(HUD hud)
onDetachedFromHUD in class Widgethud - the HUD, the Widget is removed from
protected void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidget in class Labelprotected void init()
init in class Label
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||