|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpulpcore.sprite.Sprite
pulpcore.sprite.TextField
public class TextField
The TextField is a Sprite that behaves like a common UI text input
field. It handles selection, cut, copy, paste, keyboard traversal and mouse
input. By default, a TextField's cursor is Input.CURSOR_TEXT.
| Field Summary | |
|---|---|
Color |
caretColor
The caret color. |
Color |
selectionColor
The highlight color to use when text is selected. |
| Fields inherited from class pulpcore.sprite.Sprite |
|---|
alpha, angle, CENTER, DEFAULT, EAST, enabled, height, NORTH, NORTH_EAST, NORTH_WEST, pixelSnapping, SOUTH, SOUTH_EAST, SOUTH_WEST, visible, WEST, width, x, y |
| Constructor Summary | |
|---|---|
TextField(CoreFont font,
CoreFont selectionFont,
String text,
double x,
double y)
|
|
TextField(CoreFont font,
CoreFont selectionFont,
String text,
double x,
double y,
double w,
double h)
If height < 0, the height is automatically set to fit the font height. |
|
TextField(CoreFont font,
CoreFont selectionFont,
String text,
int x,
int y)
|
|
TextField(CoreFont font,
CoreFont selectionFont,
String text,
int x,
int y,
int w,
int h)
If height < 0, the height is automatically set to fit the font height. |
|
TextField(double x,
double y,
double w,
double h)
If height < 0, the height is automatically set to fit the font height. |
|
TextField(int x,
int y,
int w,
int h)
If height < 0, the height is automatically set to fit the font height. |
|
TextField(String text,
double x,
double y)
|
|
TextField(String text,
double x,
double y,
double w,
double h)
If height < 0, the height is automatically set to fit the font height. |
|
TextField(String text,
int x,
int y)
|
|
TextField(String text,
int x,
int y,
int w,
int h)
If height < 0, the height is automatically set to fit the font height. |
|
| Method Summary | |
|---|---|
protected void |
drawSprite(CoreGraphics g)
Draws the sprite. |
int |
getCaretPosition()
|
int |
getMaxNumChars()
|
protected int |
getNaturalHeight()
|
protected int |
getNaturalWidth()
|
String |
getText()
|
boolean |
hasFocus()
|
boolean |
isPasswordMode()
|
void |
selectAll()
|
void |
setCaretPosition(int position)
|
void |
setCaretPosition(int position,
boolean selectMode)
|
void |
setFocus(boolean hasFocus)
|
void |
setMaxNumChars(int maxNumChars)
|
void |
setPasswordMode(boolean passwordMode)
|
void |
setText(String text)
|
void |
update(int elapsedTime)
Updates all of this Sprite's properties. |
| Methods inherited from class pulpcore.sprite.Sprite |
|---|
bindLocationTo, bindSizeTo, clearCursor, clearDirtyRect, contains, draw, getAnchor, getAnchorX, getAnchorY, getBlendMode, getCursor, getDirtyRect, getLocalX, getLocalY, getParent, getPixelLevelChecks, getRoot, getScene2D, getViewX, getViewX, getViewY, getViewY, intersects, isDirty, isEnabled, isEnabledAndVisible, isMouseDoubleClicked, isMouseDown, isMouseHover, isMouseOver, isMousePressed, isMouseReleased, isMouseTripleClicked, isMouseWheelRotated, isPick, isPickEnabledAndVisible, isTransparent, move, move, move, move, move, move, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, propertyChange, scale, scale, scale, scale, scale, scale, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, scaleTo, setAnchor, setBlendMode, setCursor, setDirty, setLocation, setLocation, setSize, setSize, translate, translate, updateDirtyRect |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Color selectionColor
public final Color caretColor
| Constructor Detail |
|---|
public TextField(int x,
int y,
int w,
int h)
public TextField(double x,
double y,
double w,
double h)
public TextField(String text,
int x,
int y)
public TextField(String text,
int x,
int y,
int w,
int h)
public TextField(String text,
double x,
double y)
public TextField(String text,
double x,
double y,
double w,
double h)
public TextField(CoreFont font,
CoreFont selectionFont,
String text,
int x,
int y)
public TextField(CoreFont font,
CoreFont selectionFont,
String text,
int x,
int y,
int w,
int h)
public TextField(CoreFont font,
CoreFont selectionFont,
String text,
double x,
double y)
public TextField(CoreFont font,
CoreFont selectionFont,
String text,
double x,
double y,
double w,
double h)
| Method Detail |
|---|
protected int getNaturalWidth()
getNaturalWidth in class Spriteprotected int getNaturalHeight()
getNaturalHeight in class Spritepublic boolean isPasswordMode()
public void setPasswordMode(boolean passwordMode)
public String getText()
public void setText(String text)
public void setMaxNumChars(int maxNumChars)
public int getMaxNumChars()
public boolean hasFocus()
public void setFocus(boolean hasFocus)
public void setCaretPosition(int position)
public void setCaretPosition(int position,
boolean selectMode)
public int getCaretPosition()
public void update(int elapsedTime)
Sprite
update in class Spritepublic void selectAll()
protected void drawSprite(CoreGraphics g)
Sprite
drawSprite in class Sprite
|
PulpCore | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||