|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.text.DefineText2
public final class DefineText2
DefineText2 defines one or more lines of transparent text.
It extends the functionality provided by the DefineText
class by
encoding the alpha channel of the colour objects used to set the text color.
DefineText2 class acts as a container for the text. The bounding rectangle and transform controls how the text is laid out. Each TextSpan object 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
,
DefineText
Constructor Summary | |
---|---|
DefineText2(DefineText2 object)
Creates and initialises a DefineText2 object using the values copied from another DefineText2 object. |
|
DefineText2(int uid,
Bounds rect,
CoordTransform matrix,
List<TextSpan> list)
Creates a DefineText2 object with the specified bounding rectangle, coordinate transform and text records. |
|
DefineText2(SWFDecoder coder,
Context context)
Creates and initialises a DefineText2 object using values encoded in the Flash binary format. |
Method Summary | |
---|---|
DefineText2 |
add(TextSpan obj)
Add a TextSpan object to the list of text spans. |
DefineText2 |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
Bounds |
getBounds()
Returns 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 DefineText2(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 DefineText2(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 TextSpan objects that define the text to be
displayed. Must not be null.public DefineText2(DefineText2 object)
object
- a DefineText2 object from which the values will be
copied.Method Detail |
---|
public int getIdentifier()
getIdentifier
in interface DefineTag
public void setIdentifier(int uid)
setIdentifier
in interface DefineTag
uid
- a unique identifier for the object. Must be in the range
1..65535.public DefineText2 add(TextSpan obj)
obj
- an TextSpan object. Must not be null.
public Bounds getBounds()
getBounds
in interface StaticTextTag
public CoordTransform getTransform()
getTransform
in interface StaticTextTag
public List<TextSpan> getSpans()
getSpans
in interface StaticTextTag
public void setBounds(Bounds rect)
setBounds
in interface StaticTextTag
rect
- the bounding rectangle enclosing the text. Must not be null.public void setTransform(CoordTransform matrix)
setTransform
in interface StaticTextTag
matrix
- an CoordTransform to change the size and orientation of the
text. Must not be null.public void setSpans(List<TextSpan> list)
setSpans
in interface StaticTextTag
list
- a list of TextSpan objects that define the text to be
displayed. Must not be null.public DefineText2 copy()
copy
in interface Copyable<MovieTag>
public String toString()
toString
in class Object
public int prepareToEncode(Context context)
prepareToEncode
in interface SWFEncodeable
context
- 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 SWFEncodeable
coder
- 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 |