|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.shape.DefineMorphShape2
public final class DefineMorphShape2
DefineMorphShape2 defines a shape that will morph from one form into another.
It extends the functionality of DefineMorphShape by using LineStyle2
objects rather than LineStyle1.
Only the start and end shapes are defined the Flash Player will perform the interpolation that transforms the shape at each staging in the morphing process.
Morphing can be applied to any shape, however there are a few restrictions:
To perform the morphing of a shape the shape is placed in the display list using a PlaceObject2 object. The ratio attribute in the PlaceObject2 object defines the progress of the morphing process. The ratio ranges between 0 and 65535 where 0 represents the start of the morphing process and 65535, the end.
The edges in the shapes may change their type when a shape is morphed. Straight edges can become curves and vice versa.
| Constructor Summary | |
|---|---|
DefineMorphShape2(DefineMorphShape2 object)
Creates and initialises a DefineMorphShape2 object using the values copied from another DefineMorphShape2 object. |
|
DefineMorphShape2(int uid,
Bounds startRect,
Bounds endRect,
List<FillStyle> fills,
List<LineStyle> lines,
Shape initialShape,
Shape finalShape)
Creates a DefineMorphShape object. |
|
DefineMorphShape2(SWFDecoder coder,
Context context)
Creates and initialises a DefineMorphShape2 object using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
DefineMorphShape2 |
add(FillStyle aFillStyle)
Add the fill style object to the list of fill styles. |
DefineMorphShape2 |
add(LineStyle style)
Add a LineStyle object to the list of line styles. |
DefineMorphShape2 |
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 Bounds object that defines the bounding rectangle enclosing the start shape. |
Bounds |
getEdgeBounds()
Get the Bounds object that defines the bounding rectangle enclosing the starting shape, excluding the width of the lines used. |
Bounds |
getEndBounds()
Get the Bounds object that defines the bounding rectangle enclosing the end shape. |
Bounds |
getEndEdgeBounds()
Get the Bounds object that defines the bounding rectangle enclosing the end shape, excluding the width of the lines used. |
Shape |
getEndShape()
Get shape displayed at the end of the morphing process. |
List<FillStyle> |
getFillStyles()
Returns the list of fill styles (MorphSolidFill, MorphBitmapFill and MorphGradientFill objects) for the shapes. |
int |
getIdentifier()
Get the unique identifier assigned to this object. |
List<LineStyle> |
getLineStyles()
Get the list of line styles (MorphLineStyle2 objects) for the shapes. |
Shape |
getShape()
Get shape displayed at the start of the morphing process. |
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 starting bounds of the shape. |
void |
setEdgeBounds(Bounds rect)
Sets the starting bounds of the shape. |
void |
setEndBounds(Bounds rect)
Sets the ending bounds of the shape. |
void |
setEndEdgeBounds(Bounds rect)
Sets the ending bounds of the shape. |
void |
setEndShape(Shape aShape)
Sets the shape that will be displayed at the end of the morphing process. |
void |
setFillStyles(List<FillStyle> list)
Sets the list of morph fill styles. |
void |
setIdentifier(int uid)
Sets the unique identifier for an object within a given Movie. |
void |
setLineStyles(List<LineStyle> list)
Sets the list of morph line styles. |
void |
setShape(Shape aShape)
Sets the shape that will be displayed at the start of the morphing process. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefineMorphShape2(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 DefineMorphShape2(int uid,
Bounds startRect,
Bounds endRect,
List<FillStyle> fills,
List<LineStyle> lines,
Shape initialShape,
Shape finalShape)
uid - an unique identifier for this object. Must be in the range
1..65535.startRect - the bounding rectangle enclosing the start shape. Must not be
null.endRect - the bounding rectangle enclosing the end shape. Must not be
null.fills - a list of MorphSolidFill, MorphBitmapFill and
MorphGradientFill objects. Must not be null.lines - a list of MorphLineStyle objects. Must not be null.initialShape - the shape at the start of the morphing process. Must not be
null.finalShape - the shape at the end of the morphing process. Must not be
null.public DefineMorphShape2(DefineMorphShape2 object)
object - a DefineMorphShape2 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 DefineMorphShape2 add(LineStyle style)
add in interface ShapeTagstyle - a MorphLineStyle2 object. Must not be null. Must be an
instance of MorphLineStyle2.
public DefineMorphShape2 add(FillStyle aFillStyle)
add in interface ShapeTagaFillStyle - an FillStyle object. Must not be null.
public Bounds getBounds()
getBounds in interface ShapeTagpublic Bounds getEndBounds()
public Bounds getEdgeBounds()
public Bounds getEndEdgeBounds()
public List<FillStyle> getFillStyles()
getFillStyles in interface ShapeTagpublic List<LineStyle> getLineStyles()
getLineStyles in interface ShapeTagpublic Shape getShape()
getShape in interface ShapeTagpublic Shape getEndShape()
public void setBounds(Bounds rect)
setBounds in interface ShapeTagrect - the bounding rectangle enclosing the start shape. Must not be
null.public void setEndBounds(Bounds rect)
rect - the bounding rectangle enclosing the end shape. Must not be
null.public void setEdgeBounds(Bounds rect)
rect - the bounding rectangle enclosing the start shape. Must not be
null.public void setEndEdgeBounds(Bounds rect)
rect - the bounding rectangle enclosing the end shape. Must not be
null.public void setFillStyles(List<FillStyle> list)
setFillStyles in interface ShapeTaglist - a list of MorphSolidFill, MorphBitmapFill and
MorphGradientFill objects. Must not be null.public void setLineStyles(List<LineStyle> list)
setLineStyles in interface ShapeTaglist - a list of MorphLineStyle2 objects. Must not be null.public void setShape(Shape aShape)
setShape in interface ShapeTagaShape - the shape at the start of the morphing process. Must not be
null.public void setEndShape(Shape aShape)
aShape - the shape at the end of the morphing process. Must not be
null.public DefineMorphShape2 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 | |||||||||