|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.shape.ShapeStyle
public final class ShapeStyle
ShapeStyle is used to change the drawing environment when a shape is drawn. Three operations can be performed:
An ShapeStyle object can specify one or more of the operations rather than specifying them in separate ShapeStyle objects - compacting the size of the binary data when the object is encoded. Conversely if an operation is not defined then the values may be omitted.
Line and Fill styles are selected by the index position, starting at 1, of the style in a list of styles. An index of zero means that no style is used. Two types of fill style are supported: fillStyle is used where a shape does not contain overlapping areas and altFillStyle is used where areas overlap. This differs from graphics environments that only support one fill style as the overlapping area would form a hole in the shape and not be filled.
A new drawing point is specified using the absolute x and y coordinates. If an ShapeStyle object is the first in a shape then the current drawing point is the origin of the shape (0,0). As with the line and fill styles, specifying a move is optional.
Finally the line or fill style lists may left empty if no new styles are being specified.
Constructor Summary | |
---|---|
ShapeStyle()
Creates an uninitialised ShapeStyle object. |
|
ShapeStyle(int flags,
SWFDecoder coder,
Context context)
Creates and initialises a ShapeStyle object using values encoded in the Flash binary format. |
|
ShapeStyle(ShapeStyle object)
Creates and initialises a ShapeStyle object using the values copied from another ShapeStyle object. |
Method Summary | |
---|---|
ShapeStyle |
add(FillStyle style)
Add the fill style object to the list of fill styles. |
ShapeStyle |
add(LineStyle1 style)
Add a LineStyle object to the list of line styles. |
ShapeStyle |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
Integer |
getAltFillStyle()
Get the index of the fill style that will be applied to any overlapping area filled. |
Integer |
getFillStyle()
Get the index of the fill style that will be applied to any area filled. |
List<FillStyle> |
getFillStyles()
Returns the list of new fill styles. |
Integer |
getLineStyle()
Get the index of the line style that will be applied to any line drawn. |
List<LineStyle1> |
getLineStyles()
Get the list of new line styles. |
Integer |
getMoveX()
Get the x-coordinate of any relative move or null if no move is specified. |
Integer |
getMoveY()
Get the y-coordinate of any relative move or null if no move is specified. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
ShapeStyle |
setAltFillStyle(Integer anIndex)
Sets the index of the fill style that will be applied to any overlapping area filled. |
ShapeStyle |
setFillStyle(Integer anIndex)
Sets the index of the fill style that will be applied to any area filled. |
ShapeStyle |
setFillStyles(List<FillStyle> list)
Sets the list of new fill styles. |
ShapeStyle |
setLineStyle(Integer anIndex)
Sets the index of the line style that will be applied to any line drawn. |
ShapeStyle |
setLineStyles(List<LineStyle1> list)
Sets the list of new line styles. |
ShapeStyle |
setMove(Integer xCoord,
Integer yCoord)
Sets the coordinates of any relative move. |
ShapeStyle |
setMoveX(Integer coord)
Sets the x-coordinate of any relative move. |
ShapeStyle |
setMoveY(Integer coord)
Sets the x-coordinate of any relative move. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ShapeStyle(int flags, SWFDecoder coder, Context context) throws IOException
flags
- contains fields identifying which fields are optionally
encoded in the data - decoded by parent object.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 ShapeStyle()
public ShapeStyle(ShapeStyle object)
object
- a ShapeStyle object from which the values will be
copied.Method Detail |
---|
public ShapeStyle add(LineStyle1 style)
style
- and LineStyle object. Must not be null.
public ShapeStyle add(FillStyle style)
style
- and FillStyle object. Must not be null.
public Integer getMoveX()
public Integer getMoveY()
public Integer getLineStyle()
public Integer getFillStyle()
public Integer getAltFillStyle()
public List<LineStyle1> getLineStyles()
public List<FillStyle> getFillStyles()
public ShapeStyle setMoveX(Integer coord)
coord
- move the current point by aNumber in the x direction. Must be
in the range -65535..65535.
public ShapeStyle setMoveY(Integer coord)
coord
- move the current point by aNumber in the x direction. Must be
in the range -65535..65535.
public ShapeStyle setMove(Integer xCoord, Integer yCoord)
xCoord
- move the current point by aNumber in the x direction. Must be
in the range -65535..65535.yCoord
- move the current point by aNumber in the y direction. Must be
in the range -65535..65535.
public ShapeStyle setFillStyle(Integer anIndex)
anIndex
- selects the fill style at anIndex in the fill styles list of
the parent Shape object.
public ShapeStyle setAltFillStyle(Integer anIndex)
anIndex
- selects the alternate fill style at anIndex in the fill styles
list of the parent Shape object.
public ShapeStyle setLineStyle(Integer anIndex)
anIndex
- selects the line style at anIndex in the line styles list of
the parent Shape object.
public ShapeStyle setLineStyles(List<LineStyle1> list)
list
- a list of LineStyle objects. Must not be null.
public ShapeStyle setFillStyles(List<FillStyle> list)
list
- a list of fill style objects. Must not be null.
public ShapeStyle copy()
copy
in interface Copyable<ShapeRecord>
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 |