|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.text.DefineTextField
public final class DefineTextField
DefineTextField defines an editable text field.
The value entered into the text field is assigned to a specified variable allowing the creation of forms to accept values entered by a person viewing the Flash file.
The class contains a complex set of attributes which allows a high degree of control over how a text field is displayed:
| wordWrap | Indicates whether the text should be wrapped. |
| multiline | Indicates whether the text field contains multiple lines. |
| password | Indicates whether the text field will be used to display a password. |
| readOnly | Indicates whether the text field is read only. |
| selectable | Indicates whether the text field is selectable. |
| bordered | Indicates whether the text field is bordered. |
| HTML | Indicates whether the text field contains HTML. |
| useFontGlyphs | Use either the glyphs defined in the movie to display the text or load the specified from the platform on which the Flash Player is hosted. |
| autosize | Indicates whether the text field will resize automatically to fit the text entered. |
| maxLength | The maximum length of the text field. May be set to zero is not maximum length is defined. |
Additional layout information for the spacing of the text relative to the text field borders can also be specified through the following set of attributes:
| alignment | The text in the field is left-aligned, right-aligned, centred. |
| leftMargin | Left margin in twips. |
| rightMargin | Right margin in twips. |
| indent | Text indentation in twips. |
| leading | Leading in twips. |
HTML Support
Setting the HTML flag to true allows text marked up with a limited set of
HTML tags to be displayed in the text field. The following tags are
supported:
| <p></p> | Delimits a paragraph. Only the align attribute is supported:
|
| <br> | Inserts a line break. |
| <a></a> | Define a hyperlink. Two attributes are supported:
|
| <font></font> | Format enclosed text using the font. Three attributes are supported:
|
| <b></b> | Delimits text that should be displayed in bold. |
| <b></b> | Delimits text that should be displayed in italics. |
| <b></b> | Delimits text that should be displayed underlined. |
| <li></li> | Display bulleted paragraph. Strictly speaking this is not an HTML list. The <ul> tag is not required and no list formats are supported. |
| Constructor Summary | |
|---|---|
DefineTextField(DefineTextField object)
Creates and initialises a DefineTextField object using the values copied from another DefineTextField object. |
|
DefineTextField(int uid)
Creates an DefineTextField object with the specified identifier. |
|
DefineTextField(SWFDecoder coder,
Context context)
Creates and initialises a DefineTextField object using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
DefineTextField |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
HorizontalAlign |
getAlignment()
Get the alignment of the text, either AlignLeft, AlignRight, AlignCenter or AlignJustify. |
Bounds |
getBounds()
Returns the bounding rectangle that completely encloses the text field. |
Color |
getColor()
Get the text color. |
String |
getFontClass()
Get the name of the Actionscript 3 class that provides the font. |
int |
getFontHeight()
Get the size of the font used to display the text. |
int |
getFontIdentifier()
Get the identifier of the font used to display the characters. |
int |
getIdentifier()
Get the unique identifier assigned to this object. |
int |
getIndent()
Get the indentation of the first line of text in twips. |
String |
getInitialText()
Get the default text displayed in the field. |
int |
getLeading()
Get the leading in twips. |
int |
getLeftMargin()
Get the left margin in twips. |
int |
getMaxLength()
Get the maximum number of characters displayed in the field. |
int |
getRightMargin()
Get the right margin in twips. |
String |
getVariableName()
Get the name of the variable the value in the text field will be assigned to. |
boolean |
isAutoSize()
Does the text field resize to fit the contents. |
boolean |
isBordered()
Is the text field bordered. |
boolean |
isEmbedded()
Indicates whether the text will be displayed using the font defined in the movie or whether a font defined on the host platform will be used. |
boolean |
isHtml()
Does the text field contain HTML. |
boolean |
isMultiline()
Does the text field support multiple lines of text. |
boolean |
isPassword()
Does the text field protect passwords being entered. |
boolean |
isReadOnly()
Is the text field read-only. |
boolean |
isSelectable()
Is the text field selectable. |
boolean |
isWordWrapped()
Does the text field support word wrapping. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
DefineTextField |
setAlignment(HorizontalAlign align)
Sets the alignment of the text, either AlignLeft, AlignRight, AlignCenter or AlignJustify. |
DefineTextField |
setAutoSize(boolean aFlag)
Sets whether the text field will resize to fit the contents. |
DefineTextField |
setBordered(boolean aFlag)
Set whether the text field is bordered. |
DefineTextField |
setBounds(Bounds rect)
Sets the bounding rectangle of the text field. |
DefineTextField |
setColor(Color aColor)
Sets the text color. |
DefineTextField |
setEmbedded(boolean aFlag)
Set whether the text field characters are displayed using the font defined in the movie or whether the Flash Player uses a font definition loaded from the platform on which it is hosted. |
DefineTextField |
setFontClass(String name)
Set the name of the Actionscript 3 class that provides the font. |
DefineTextField |
setFontHeight(int aNumber)
Sets the height of the characters. |
DefineTextField |
setFontIdentifier(int uid)
Sets the identifier of the font used to display the characters. |
DefineTextField |
setHtml(boolean aFlag)
Set whether the text field contains HTML. |
void |
setIdentifier(int uid)
Sets the unique identifier for an object within a given Movie. |
DefineTextField |
setIndent(Integer aNumber)
Returns the indentation of the first line of text in twips. |
DefineTextField |
setInitialText(String aString)
Sets the value that will initially be displayed in the text field. |
DefineTextField |
setLeading(Integer aNumber)
Sets the spacing between lines, measured in twips. |
DefineTextField |
setLeftMargin(Integer aNumber)
Sets the left margin in twips. |
DefineTextField |
setMaxLength(int aNumber)
Sets the maximum length of the text displayed. |
DefineTextField |
setMultiline(boolean aFlag)
Set whether the text field contains multiple lines of text. |
DefineTextField |
setPassword(boolean aFlag)
Set whether the text field should protect passwords entered. |
DefineTextField |
setReadOnly(boolean aFlag)
Set whether the text field is read-only. |
DefineTextField |
setRightMargin(Integer aNumber)
Sets the right margin in twips. |
DefineTextField |
setSelectable(boolean aFlag)
Set whether the text field is selectable. |
DefineTextField |
setVariableName(String aString)
Sets the name of the variable the value in the text field will be assigned to. |
DefineTextField |
setWordWrapped(boolean aFlag)
Set whether the text field supports word wrapping. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefineTextField(SWFDecoder coder,
Context context)
throws IOException
coder - an SWFDecoder object that contains the encoded Flash data.context - a Context object used to manage the decoders for different
type of object and to pass information on how objects are
decoded.
IOException - if an error occurs while decoding the data.public DefineTextField(int uid)
uid - the unique identifier for the text field.public DefineTextField(DefineTextField object)
object - a DefineTextField object from which the values will be
copied.| Method Detail |
|---|
public int getIdentifier()
getIdentifier in interface DefineTagpublic void setIdentifier(int uid)
setIdentifier in interface DefineTaguid - a unique identifier for the object. Must be in the range
1..65535.public Bounds getBounds()
public boolean isWordWrapped()
public boolean isMultiline()
public boolean isPassword()
public boolean isReadOnly()
public boolean isSelectable()
public boolean isBordered()
public boolean isHtml()
public boolean isAutoSize()
public DefineTextField setAutoSize(boolean aFlag)
aFlag - indicate whether the text field will resize automatically.
public boolean isEmbedded()
public int getFontIdentifier()
public String getFontClass()
public int getFontHeight()
public Color getColor()
public int getMaxLength()
public HorizontalAlign getAlignment()
public int getLeftMargin()
public int getRightMargin()
public int getIndent()
public int getLeading()
public String getVariableName()
public String getInitialText()
public DefineTextField setBounds(Bounds rect)
rect - the bounding rectangle enclosing the text field. Must not be
null.
public DefineTextField setWordWrapped(boolean aFlag)
aFlag - set whether the text field is word wrapped.
public DefineTextField setMultiline(boolean aFlag)
aFlag - set whether the text field is multiline.
public DefineTextField setPassword(boolean aFlag)
aFlag - set whether the text field is password protected.
public DefineTextField setReadOnly(boolean aFlag)
aFlag - set whether the text field is read-only.
public DefineTextField setSelectable(boolean aFlag)
aFlag - set whether the text field is selectable.
public DefineTextField setBordered(boolean aFlag)
aFlag - set whether the text field is bordered.
public DefineTextField setHtml(boolean aFlag)
aFlag - set whether the text field contains HTML.
public DefineTextField setEmbedded(boolean aFlag)
aFlag - set whether the text field characters will be drawn using the
font in the movie (true) or use a font loaded by the Flash
Player (false).
public DefineTextField setFontIdentifier(int uid)
uid - the identifier for the font that the text will be rendered in.
Must be in the range 1..65535.
public DefineTextField setFontClass(String name)
name - the name the Actionscript class.
public DefineTextField setFontHeight(int aNumber)
aNumber - the height of the font. Must be in the range 0..65535.
public DefineTextField setColor(Color aColor)
aColor - the colour object that defines the text colour.
public DefineTextField setMaxLength(int aNumber)
aNumber - the maximum number of characters displayed in the field. Must
be in the range 0..65535.
public DefineTextField setAlignment(HorizontalAlign align)
align - the type of alignment. Must be either ALIGN_LEFT, ALIGN_RIGHT
or ALIGN_JUSTIFY.
public DefineTextField setLeftMargin(Integer aNumber)
aNumber - the width of the left margin. Must be in the range 0..65535.
public DefineTextField setRightMargin(Integer aNumber)
aNumber - the width of the right margin. Must be in the range 0..65535.
public DefineTextField setIndent(Integer aNumber)
aNumber - the indentation for the first line. Must be in the range
0..65535.
public DefineTextField setLeading(Integer aNumber)
aNumber - the value for the leading. Must be in the range -32768..32767.
public DefineTextField setVariableName(String aString)
aString - the name of the variable.
public DefineTextField setInitialText(String aString)
aString - the initial text displayed.
public DefineTextField copy()
copy in interface Copyable<MovieTag>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
public void encode(SWFEncoder coder,
Context context)
throws IOException
encode in interface SWFEncodeablecoder - an SWFEncoder object.context - an Context that allows information to be passed between
objects to control how they are initialised for encoding.
IOException - if an error occurs while encoding the object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||