|
|||||||||
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.FSFillStyle
com.flagstone.transform.FSMorphBitmapFill
public class FSMorphBitmapFill
FSMorphBitmapFill uses a bitmap image to fill an area of a morphing shape.
Two types of bitmap fill are supported:
Attributes | |
---|---|
type | The type of bitmap fill, either FSFillStyle.Tiled or FSFillStyle.Clipped. |
identifier | The identifier of the image that will be displayed. |
start | An optional FSCoordTransform object that will be applied to the image, to change its origin, orientation, etc., at the start of the morphing process. |
end | An optional FSCoordTransform object that will be applied to the image, to change its origin, orientation, etc., at the end of the morphing process. |
The bitmap is referenced using the identifier obtains from an instance of an FSDefineJPEGImage, FSDefineJPEGImage2, FSDefineJPEGImage3, FSDefineImage or FSDefineImage2 object. Only one image can be displayed throughout the morphing process.
When an image is loaded its width and height default to twips rather than pixels. An image 300 x 200 pixels will be displayed as 300 x 200 twips (15 x 10 pixels). Scaling the image by 20 (20 twips = 1 pixel) would restore it to its original size. The FSCoordTransform attribute in the FSBitmapFill object can be used to scale the image to its original size.
The image is drawn with the top left corner at the origin of the shape being filled so the scaling transform must be composited with the translation transform that places the image at the desired location within the shape.
The FSMorphBitmapFill class represents the MorphFillStyle structure from the Macromedia Flash (SWF) File Format Specification. Shape morphing was introduced in Flash 3.
Field Summary |
---|
Fields inherited from class com.flagstone.transform.FSFillStyle |
---|
Clipped, Linear, Radial, Solid, Tiled, type, Unsmoothed_Clipped, Unsmoothed_Tiled |
Constructor Summary | |
---|---|
FSMorphBitmapFill(FSCoder coder)
Construct an FSMorphBitmapFill object an initialise it with values decoded from an encoded FSMorphBitmapFill object. |
|
FSMorphBitmapFill(FSMorphBitmapFill obj)
Construct an FSMorphBitmapFill object by copying an existing object. |
|
FSMorphBitmapFill(int aType,
int anIdentifier,
FSCoordTransform aStartTransform,
FSCoordTransform anEndTransform)
Constructs an FSMorphBitmapFill specifying the type, bitmap image and coordinated transforms for the image at the start and end of the morphing process. |
Method Summary | |
---|---|
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. |
FSCoordTransform |
getEndTransform()
Gets the ending coordinate transform for the image. |
int |
getIdentifier()
Gets the identifier of the bitmap image. |
FSCoordTransform |
getStartTransform()
Gets the starting coordinate transform for the image. |
int |
length(FSCoder coder)
|
void |
setEndTransform(FSCoordTransform aTransform)
Sets the coordinate transform for the image at the end of the morphing process. |
void |
setIdentifier(int anIdentifier)
Sets the identifier of the bitmap image to be used in the morphing process. |
void |
setStartTransform(FSCoordTransform aTransform)
Sets the coordinate transform for the image at the start of the morphing process. |
Methods inherited from class com.flagstone.transform.FSFillStyle |
---|
getType, setType |
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 FSMorphBitmapFill(FSCoder coder)
coder
- an FSCoder object containing an FSMorphBitmapFill encoded as
binary data.public FSMorphBitmapFill(int aType, int anIdentifier, FSCoordTransform aStartTransform, FSCoordTransform anEndTransform)
aType
- the type of fill either FSFillStyle.Tiled or
FSFillStyle.Clipped.anIdentifier
- the identifier for the bitmap image.aStartTransform
- the transform applied to the image at the start of the
morphing process.anEndTransform
- the transform applied to the image at the end of the morphing
process.public FSMorphBitmapFill(FSMorphBitmapFill obj)
obj
- an FSMorphBitmapFill object.Method Detail |
---|
public int getIdentifier()
public FSCoordTransform getStartTransform()
public FSCoordTransform getEndTransform()
public void setIdentifier(int anIdentifier)
anIdentifier
- the identifier of the bitmap image.public void setStartTransform(FSCoordTransform aTransform)
aTransform
- the starting coordinate transform.public void setEndTransform(FSCoordTransform aTransform)
aTransform
- the ending coordinate transform.public java.lang.Object clone()
FSTransformObject
clone
in class FSTransformObject
public boolean equals(java.lang.Object anObject)
FSFillStyle
equals
in class FSFillStyle
public void appendDescription(java.lang.StringBuffer buffer, int depth)
FSTransformObject
appendDescription
in class FSTransformObject
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 FSFillStyle
public void encode(FSCoder coder)
encode
in class FSFillStyle
public void decode(FSCoder coder)
decode
in class FSFillStyle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |