|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.shape.Shape
public final class Shape
Shape is a container class for the shape objects (Line, Curve, ShapeStyle and ShapeStyle2 objects) that describe how a particular shape is drawn.
Shapes are used in shape and font definitions. The Shape class is used to simplify the design of these classes and provides no added functionality other than acting as a container class.
Field Summary | |
---|---|
static int |
MAX_COORD
The maximum coordinate in along the x or y axes. |
static int |
MIN_COORD
The minimum coordinate in along the x or y axes. |
Constructor Summary | |
---|---|
Shape()
Constructs an empty Shape. |
|
Shape(List<ShapeRecord> list)
Creates a Shape object, specifying the Objects that describe how the shape is drawn. |
|
Shape(Shape object)
Creates and initialises a Shape object using the values copied from another Shape object. |
|
Shape(SWFDecoder coder,
Context context)
Creates and initialises a Shape object using values encoded in the Flash binary format. |
Method Summary | |
---|---|
Shape |
add(ShapeRecord anObject)
Adds the object to the list of shape records. |
Shape |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
List<ShapeRecord> |
getObjects()
Get the list of shape records that define the shape. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setObjects(List<ShapeRecord> list)
Sets the list of shape records. |
static Shape |
shapeFromData(ShapeData shapeData)
Decode a ShapeData object into the set of ShapeRecord objects that describe how a shape is drawn. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MIN_COORD
public static final int MAX_COORD
Constructor Detail |
---|
public Shape(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 Shape()
public Shape(List<ShapeRecord> list)
list
- the list of shape records. Must not be null.public Shape(Shape object)
object
- a Shape object from which the values will be copied.Method Detail |
---|
public static Shape shapeFromData(ShapeData shapeData) throws IOException
shapeData
- a ShapeData object containing the encoded shape.
IOException
- if there is an error decoding the shape.public Shape add(ShapeRecord anObject)
anObject
- an instance of ShapeStyle, Line or Curve. Must not be null.
public List<ShapeRecord> getObjects()
public void setObjects(List<ShapeRecord> list)
list
- the list of shape records. Must not be null.public Shape copy()
copy
in interface Copyable<Shape>
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 |