|
|||||||||
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.FSDefineShape3
public class FSDefineShape3
FSDefineShape3 defines a transparent shape to be displayed.
It extends the functionality of the FSDefineShape2 class by supporting transparent colours.
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 area inside which the shape is drawn. |
fillStyles | An array of fill styles used to fill the area enclosed by the shape. |
lineStyles | An array of line styles used to draw the outline of the shape. |
shape | An FSShape object containing the shape records (FSLine, FSCurve and FSShapeStyle objects) that describe how the shape is drawn and filled shape. |
The shape defines a path containing a mix of straight and curved edges and pen move actions. A path need not be contiguous. When the shape is drawn the FSShapeStyle object selects the line and fill styles, from the respective array, to be used. FSShapeStyle objects can be defined in the shape at any time to change the styles being used. The fill style used can either be an area of pure colour, a bitmap image or a gradient. The line style specifies the colour and thickness of the line drawn around the shape outline. For both line and fill styles the selected style may be undefined, allowing the shape to be drawn without an outline or left unfilled.
This example creates a simple rectangle, 200 twips wide and 100 twips high, drawing using a black outline 1 twip wide and filled with a transparent red colour. The origin of the shape is at the bottom left corner of the rectangle.
// Create the bounding rectangle for the shape. The values also specify // the coordinate range of the shape. FSBounds bounds = new FSBounds(0, 0, 200, 100); // Define the styles for the shape. ArrayList fillStyles = new ArrayList(); ArrayList lineStyles = new ArrayList(); fillStyles.add(new FSSolidFill(new FSColor(255, 0, 0, 128))); lineStyles.add(new FSSolidLine(1, new FSColor(0, 0, 0, 128))); // Draw the shape. FSShape shape = new FSShape(); // Define the line, fill styles and move to the shape's origin. shape.add(new FSShapeStyle(1, 1, 0, 0, 0)); shape.add(new FSLine(200, 0)); shape.add(new FSLine(0, 100)); shape.add(new FSLine(-200, 0)); shape.add(new FSLine(0, -100)); FSDefineShape3 shape = new FSDefineShape3(movie.newIdentifier(), bounds, fillStyles, lineStyles, shape);
The FSDefineShape3 class represents the DefineShape3 tag from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 3.
Field Summary |
---|
Fields inherited from class com.flagstone.transform.FSDefineObject |
---|
identifier |
Constructor Summary | |
---|---|
FSDefineShape3(FSCoder coder)
Construct an FSDefineShape3 object, initialising it with values decoded from an encoded object. |
|
FSDefineShape3(FSDefineShape3 obj)
Constructs an FSDefineShape object by copying values from an existing object. |
|
FSDefineShape3(int anIdentifier,
FSBounds aBounds,
java.util.ArrayList fillStyleArray,
java.util.ArrayList lineStyleArray,
FSShape aShape)
Constructs an FSDefineShape3 object. |
Method Summary | |
---|---|
void |
add(FSFillStyle aFillStyle)
Add the fill style object to the array of fill styles. |
void |
add(FSLineStyle aLineStyle)
Add a FSSolidLine object to the array of line styles. |
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. |
FSBounds |
getBounds()
Gets the bounding rectangle for the shape. |
java.util.ArrayList |
getFillStyles()
Gets the array fill styles. |
java.util.ArrayList |
getLineStyles()
Gets the array line styles. |
FSShape |
getShape()
Gets the shape. |
int |
length(FSCoder coder)
|
void |
setBounds(FSBounds aBounds)
Sets the bounding rectangle. |
void |
setFillStyles(java.util.ArrayList anArray)
Sets the fill styles. |
void |
setLineStyles(java.util.ArrayList anArray)
Sets the line styles. |
void |
setShape(FSShape aShape)
Sets the shape. |
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 |
Constructor Detail |
---|
public FSDefineShape3(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSDefineShape3(int anIdentifier, FSBounds aBounds, java.util.ArrayList fillStyleArray, java.util.ArrayList lineStyleArray, FSShape aShape)
anIdentifier
- the unique identifier for the shape.aBounds
- the bounding rectangle for the shape.fillStyleArray
- the array of fill styles used in the shape.lineStyleArray
- the array of line styles used in the shape.aShape
- the shape to be drawn.public FSDefineShape3(FSDefineShape3 obj)
obj
- an FSDefineShape object.Method Detail |
---|
public void add(FSLineStyle aLineStyle)
aLineStyle
- and FSSolidLine object.public void add(FSFillStyle aFillStyle)
aFillStyle
- and FSFillStyle object.public FSBounds getBounds()
public java.util.ArrayList getFillStyles()
public java.util.ArrayList getLineStyles()
public FSShape getShape()
public void setBounds(FSBounds aBounds)
aBounds
- set the bounding rectangle for the shape.public void setFillStyles(java.util.ArrayList anArray)
anArray
- set the fill styles for the shape.public void setLineStyles(java.util.ArrayList anArray)
anArray
- set the line styles for the shape.public void setShape(FSShape aShape)
aShape
- set the shape to be drawn.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 |