|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectfang.Sprite
fang.InputFieldSprite
public class InputFieldSprite
This class enables text input within the AnimationCanvas via a special Sprite which responds to keyboard input when the specified mouse is inside the box.
| Nested Class Summary | |
|---|---|
class |
InputFieldSprite.InputTracker
This is a special tracker which responds to keyboard and mouse input and also forwards the advancing of time to another tracker which may be attached. |
| Field Summary | |
|---|---|
static double |
MARGIN
margin from the edge of the inner box |
| Fields inherited from class fang.Sprite |
|---|
color, config, DEBUG_BOUNDING_BOX, DEBUG_INTERSECTS, debugBoundingBoxColor, image, optimizeForBitmap, shape, tracker, transform |
| Constructor Summary | |
|---|---|
InputFieldSprite(int characters)
creates a StringField with space for a certain number of fixed width characters |
|
InputFieldSprite(int rows,
int characters)
creates a StringField with space for a certain number of fixed width characters |
|
InputFieldSprite(String text)
creates a StringField with a given starting text. |
|
| Method Summary | |
|---|---|
void |
addTracker(Tracker t)
adds the tracker to the sprite |
void |
disableInput()
disables all input |
void |
disableInput(Keyboard keyboard,
Mouse mouse)
diables a keyboard mouse pair |
void |
enableInput(Keyboard keyboard,
Mouse mouse)
selects which mouse and which keyboard will be allowed to edit the StringField |
Tracker[] |
getAddedTrackers()
gets all the added trackers to this sprite |
String |
getStyle()
gets the family name of the font |
String |
getText()
gets the contents of the StringField |
boolean |
isBold()
determines the thickness of the lettering |
boolean |
isItalicized()
determines if the text is slanted |
boolean |
isUnderlined()
determines if there is a line at the baseline of the text |
void |
removeTracker(Tracker t)
removes a tracker from this sprite |
void |
setBold(boolean bold)
sets the thickness of the lettering |
void |
setItalicized(boolean italics)
sets the slant of the text |
void |
setStyle(String style)
sets the family name of the font |
void |
setText(String text)
sets the sequence of characters in the StringField |
void |
setTracker(Tracker t)
this method is disabled for the StringField. |
void |
setUnderlined(boolean underline)
sets whether there should or should not be a line at the baseline of the text |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double MARGIN
| Constructor Detail |
|---|
public InputFieldSprite(int characters)
characters - the number of
characters wide to make the StringField
public InputFieldSprite(int rows,
int characters)
characters - the number of
characters wide to make the StringFieldpublic InputFieldSprite(String text)
text - the starting String| Method Detail |
|---|
public void enableInput(Keyboard keyboard,
Mouse mouse)
keyboard - mouse - public void setTracker(Tracker t)
setTracker in class Spritet - the tracker to addpublic void addTracker(Tracker t)
t - the trackerpublic Tracker[] getAddedTrackers()
public void removeTracker(Tracker t)
t - the tracker to removepublic void disableInput()
public void disableInput(Keyboard keyboard,
Mouse mouse)
keyboard - the keyboard to ignoremouse - the corresponding mousepublic void setText(String text)
text - the new sequence of
characterspublic String getText()
public void setItalicized(boolean italics)
italics - true indicates
slant, false is for no slantpublic void setBold(boolean bold)
bold - true indicates thick
lettering, false indicates normal
thicknesspublic boolean isItalicized()
public boolean isBold()
public void setUnderlined(boolean underline)
underline - true indicates there
should be a line, false indicates no line
should be therepublic String getStyle()
public void setStyle(String style)
style - the family name of the fontpublic boolean isUnderlined()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||