|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.text.DefineText
public final class DefineText
DefineText defines one or more lines of text.
The characters, style and layout information is defined using TextSpan objects. The DefineText class acts as a container for the text,
defining the bounding rectangle that encloses the text along with a
coordinate transform that can be used to change the size and orientation of
the text when it is displayed.
The bounding rectangle and transform controls how the text is laid out. Each Text object in the list of TextSpans specifies an offset from the left and bottom edges of the bounding rectangle, allowing successive lines of text to be arranged as a block or paragraph. The coordinate transform can be used to control the size and orientation of the text when it is displayed.
TextSpan| Constructor Summary | |
|---|---|
DefineText(DefineText object)
Creates and initialises a DefineText object using the values copied from another DefineText object. |
|
DefineText(int uid,
Bounds rect,
CoordTransform matrix,
List<TextSpan> list)
Creates a DefineText object with the specified bounding rectangle, coordinate transform and text records. |
|
DefineText(SWFDecoder coder,
Context context)
Creates and initialises a DefineText object using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
DefineText |
add(TextSpan obj)
Add a TextSpan object to the list of text spans. |
DefineText |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
Bounds |
getBounds()
Get the bounding rectangle that completely encloses the text to be displayed. |
int |
getIdentifier()
Get the unique identifier assigned to this object. |
List<TextSpan> |
getSpans()
Get the list of text spans that define the text to be displayed. |
CoordTransform |
getTransform()
Get the coordinate transform that controls the size, location and orientation of the text when it is displayed. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setBounds(Bounds rect)
Sets the bounding rectangle that encloses the text being displayed. |
void |
setIdentifier(int uid)
Sets the unique identifier for an object within a given Movie. |
void |
setSpans(List<TextSpan> list)
Sets the list of text spans that define the text to be displayed. |
void |
setTransform(CoordTransform matrix)
Sets the coordinate transform that changes the orientation and size of the text displayed. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefineText(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 DefineText(int uid,
Bounds rect,
CoordTransform matrix,
List<TextSpan> list)
uid - the unique identifier for this object. Must be in the range
1..65535rect - the bounding rectangle enclosing the text. Must not be null.matrix - an CoordTransform to change the size and orientation of the
text. Must not be null.list - a list of Text objects that define the text to be displayed.
Must not be null.public DefineText(DefineText object)
object - a DefineText 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 DefineText add(TextSpan obj)
obj - an TextSpan object. Must not be null.
public Bounds getBounds()
getBounds in interface StaticTextTagpublic CoordTransform getTransform()
getTransform in interface StaticTextTagpublic List<TextSpan> getSpans()
getSpans in interface StaticTextTagpublic void setBounds(Bounds rect)
setBounds in interface StaticTextTagrect - the bounding rectangle enclosing the text. Must not be null.public void setTransform(CoordTransform matrix)
setTransform in interface StaticTextTagmatrix - an CoordTransform to change the size and orientation of the
text. Must not be null.public void setSpans(List<TextSpan> list)
setSpans in interface StaticTextTaglist - a list of TextSpan objects that define the text to be
displayed. Must not be null.public DefineText 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 | |||||||||