|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.FSTransformObject
com.flagstone.transform.FSMovieObject
com.flagstone.transform.FSDefineObject
com.flagstone.transform.FSDefineTextField
public class FSDefineTextField
FSDefineTextField 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:
Attributes | |
---|---|
type | Identifies the data structure when it is encoded. Read-only. |
identifier | An unique identifier for this object in the range 1..65535. |
bounds | The bounding rectangle for the text field. |
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. |
fontIdentifier | The identifier of the font displayed in the text field. |
height | The height of the characters in twips. |
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. |
colour | The colour of the text. If set to null then the text colour defaults to black. |
maxLength | The maximum length of the text field. May be set to zero is not maximum length is defined. |
variableName | The name of the variable the text will be assigned to. |
initialText | The default text displayed in the text field. |
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 | Whether 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. |
The default values for the alignment is AlignLeft while the leftMargin, rightMargin indent and leading attributes are set to the constant Transform.VALUE_NOT_SET. If the attributes remain unchanged then the layout information will not be encoded. If any of the values in this group are set then they must all have values assigned for the field to be displayed correctly otherwise default values of 0 will be used.
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. |
<i></i> | Delimits text that should be displayed in italics. |
<u></u> | 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 other list format is supported. |
FSDefineTextField class represents the DefineTextField from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 4.
Field Summary | |
---|---|
static int |
AlignCenter
Defines that the text displayed in a text field is centre aligned. |
static int |
AlignJustify
Defines that the text displayed in a text field is justified. |
static int |
AlignLeft
Defines that the text displayed in a text field is left aligned. |
static int |
AlignRight
Defines that the text displayed in a text field is right aligned. |
static java.lang.String |
AutoSize
Key used to identify the autoSize attribute. |
static java.lang.String |
Bordered
Key used to identify the bordered attribute. |
static java.lang.String |
Color
Key used to identify the color attribute. |
static java.lang.String |
FontHeight
Key used to identify the fontHeight attribute. |
static java.lang.String |
FontIdentifier
Key used to identify the identifier attribute. |
static java.lang.String |
HTML
Key used to identify the bordered attribute. |
static java.lang.String |
Indent
Key used to identify the indent attribute. |
static java.lang.String |
InitialText
Key used to identify the initialText attribute. |
static java.lang.String |
Leading
Key used to identify the leading attribute. |
static java.lang.String |
LeftMargin
Key used to identify the leftMargin attribute. |
static java.lang.String |
MaxLength
Key used to identify the maxLength attribute. |
static java.lang.String |
Multiline
Key used to identify the multiline attribute. |
static java.lang.String |
Password
Key used to identify the password attribute. |
static java.lang.String |
ReadOnly
Key used to identify the readOnly attribute. |
static java.lang.String |
RightMargin
Key used to identify the rightMargin attribute. |
static java.lang.String |
Selectable
Key used to identify the selectable attribute. |
static java.lang.String |
UseFontGlyphs
Key used to identify the useFontGlyphs attribute. |
static java.lang.String |
VariableName
Key used to identify the variableName attribute. |
static java.lang.String |
WordWrapped
Key used to identify the wordWrapped attribute. |
Fields inherited from class com.flagstone.transform.FSDefineObject |
---|
identifier |
Constructor Summary | |
---|---|
FSDefineTextField(FSCoder coder)
Construct an FSDefineTextField object, initialising it with values decoded from an encoded object. |
|
FSDefineTextField(FSDefineTextField obj)
Constructs an FSDefineText object by copying values from an existing object. |
|
FSDefineTextField(int anIdentifier,
FSBounds aBounds)
Constructs an FSDefineTextField object with the specified identifier and with the size defined by the bounding rectangle. |
|
FSDefineTextField(int anIdentifier,
FSBounds aBounds,
java.util.Hashtable attributes)
Constructs an FSDefineTextField object setting the attributes added to the Hashtable. |
Method Summary | |
---|---|
void |
appendDescription(java.lang.StringBuffer buffer,
int depth)
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. |
java.lang.Object |
clone()
Creates a deep copy of the entire object. |
void |
decode(FSCoder coder)
|
void |
encode(FSCoder coder)
|
boolean |
equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. |
int |
getAlignment()
Gets the alignment of the text, either AlignLeft, AlignRight, AlignCenter or AlignJustify. |
java.util.Hashtable |
getAttributes()
Gets the list of attributes for the object. |
FSBounds |
getBounds()
Gets the bounding rectangle that completely encloses the text field. |
FSColor |
getColor()
Gets the text color. |
int |
getFontHeight()
Gets the height of the characters. |
int |
getFontIdentifier()
Gets the identifier of the font used to display the characters. |
int |
getIndent()
Gets the indentation of the first line of text in twips. |
java.lang.String |
getInitialText()
Gets the default text displayed in the field. |
int |
getLeading()
Gets the leading in twips. |
int |
getLeftMargin()
Gets the left margin in twips. |
int |
getMaxLength()
Gets the maximum length of the text displayed. |
int |
getRightMargin()
Gets the right margin in twips. |
java.lang.String |
getVariableName()
Gets 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 |
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 |
length(FSCoder coder)
|
void |
setAlignment(int aType)
Sets the alignment of the text, either AlignLeft, AlignRight, AlignCenter or AlignJustify. |
void |
setAttributes(java.util.Hashtable attributes)
Sets the attributes for the object. |
void |
setAutoSize(boolean aFlag)
Sets whether the text field will resize to fit the contents. |
void |
setBordered(boolean aFlag)
Set whether the text field is bordered. |
void |
setBounds(FSBounds aBounds)
Sets the bounding rectangle of the text field. |
void |
setColor(FSColor aColor)
Sets the text color. |
void |
setFontHeight(int aNumber)
Sets the height of the characters. |
void |
setFontIdentifier(int anIdentifier)
Sets the identifier of the font used to display the characters. |
void |
setHTML(boolean aFlag)
Set whether the text field contains HTML. |
void |
setIndent(int aNumber)
Gets the indentation of the first line of text in twips. |
void |
setInitialText(java.lang.String aString)
Sets the value that will initially be displayed in the text field. |
void |
setLeading(int aNumber)
Sets the leading in twips. |
void |
setLeftMargin(int aNumber)
Sets the left margin in twips. |
void |
setMaxLength(int aNumber)
Sets the maximum length of the text displayed. |
void |
setMultiline(boolean aFlag)
Set whether the text field contains multiple lines of text. |
void |
setPassword(boolean aFlag)
Set whether the text field should protect passwords entered. |
void |
setReadOnly(boolean aFlag)
Set whether the text field is read-only. |
void |
setRightMargin(int aNumber)
Sets the right margin in twips. |
void |
setSelectable(boolean aFlag)
Set whether the text field is selectable. |
void |
setUseFontGlyphs(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. |
void |
setVariableName(java.lang.String aString)
Sets the name of the variable the value in the text field will be assigned to. |
void |
setWordWrapped(boolean aFlag)
Set whether the text field supports word wrapping. |
boolean |
useFontGlyphs()
Indicates whether the test will be displayed using the font defined in the movie or whether a font defined on the host platform will be used. |
Methods inherited from class com.flagstone.transform.FSDefineObject |
---|
getIdentifier, setIdentifier |
Methods inherited from class com.flagstone.transform.FSMovieObject |
---|
getType |
Methods inherited from class com.flagstone.transform.FSTransformObject |
---|
name, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String WordWrapped
public static final java.lang.String Multiline
public static final java.lang.String Password
public static final java.lang.String ReadOnly
public static final java.lang.String Selectable
public static final java.lang.String Bordered
public static final java.lang.String HTML
public static final java.lang.String UseFontGlyphs
public static final java.lang.String AutoSize
public static final java.lang.String FontIdentifier
public static final java.lang.String FontHeight
public static final java.lang.String Color
public static final java.lang.String MaxLength
public static final java.lang.String LeftMargin
public static final java.lang.String RightMargin
public static final java.lang.String Indent
public static final java.lang.String Leading
public static final java.lang.String VariableName
public static final java.lang.String InitialText
public static final int AlignLeft
public static final int AlignRight
public static final int AlignCenter
public static final int AlignJustify
Constructor Detail |
---|
public FSDefineTextField(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSDefineTextField(int anIdentifier, FSBounds aBounds)
anIdentifier
- the unique identifier for this object.aBounds
- the bounding rectangle for the field which defines its size.public FSDefineTextField(int anIdentifier, FSBounds aBounds, java.util.Hashtable attributes)
anIdentifier
- the unique identifier for this object.aBounds
- the bounding rectangle for the field which defines its size.attributes
- a collection of key-value pairs identifying the attributes to
be set.public FSDefineTextField(FSDefineTextField obj)
obj
- an FSDefineText object.Method Detail |
---|
public FSBounds 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 void setAutoSize(boolean aFlag)
aFlag
- indicate whether the text field will resize automatically.public boolean useFontGlyphs()
public int getFontIdentifier()
public int getFontHeight()
public FSColor getColor()
public int getMaxLength()
public int getAlignment()
public int getLeftMargin()
public int getRightMargin()
public int getIndent()
public int getLeading()
public java.lang.String getVariableName()
public java.lang.String getInitialText()
public java.util.Hashtable getAttributes()
public void setBounds(FSBounds aBounds)
aBounds
- the bounding rectangle enclosing the text field.public void setWordWrapped(boolean aFlag)
aFlag
- set whether the text field is word wrapped.public void setMultiline(boolean aFlag)
aFlag
- set whether the text field is multiline.public void setPassword(boolean aFlag)
aFlag
- set whether the text field is password protected.public void setReadOnly(boolean aFlag)
aFlag
- set whether the text field is read-only.public void setSelectable(boolean aFlag)
aFlag
- set whether the text field is selectable.public void setBordered(boolean aFlag)
aFlag
- set whether the text field is bordered.public void setHTML(boolean aFlag)
aFlag
- set whether the text field contains HTML.public void setUseFontGlyphs(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 void setFontIdentifier(int anIdentifier)
anIdentifier
- the identifier for the font that the text will be rendered in.public void setFontHeight(int aNumber)
aNumber
- the height of the font.public void setColor(FSColor aColor)
aColor
- the colour object that defines the text colour.public void setMaxLength(int aNumber)
aNumber
- the maximum number of characters displayed in the field.public void setAlignment(int aType)
aType
- the type of alignment.public void setLeftMargin(int aNumber)
aNumber
- the width of the left margin.public void setRightMargin(int aNumber)
aNumber
- the width of the right margin.public void setIndent(int aNumber)
aNumber
- the indentation for the first line.public void setLeading(int aNumber)
aNumber
- the value for the leading.public void setVariableName(java.lang.String aString)
aString
- the name of the variable.public void setInitialText(java.lang.String aString)
aString
- the initial text displayed.public void setAttributes(java.util.Hashtable attributes)
attributes
- the list of attributes for the object.public java.lang.Object clone()
FSTransformObject
clone
in class FSTransformObject
public boolean equals(java.lang.Object anObject)
FSMovieObject
equals
in class FSMovieObject
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSDefineObject
buffer
- a StringBuffer to which the description of each object is
appended.depth
- the maximum level of nesting up to which objects will be
displayed.public int length(FSCoder coder)
length
in class FSDefineObject
public void encode(FSCoder coder)
encode
in class FSDefineObject
public void decode(FSCoder coder)
decode
in class FSDefineObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |