|
|||||||||
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.FSMorphGradient
public class FSMorphGradient
FSMorphGradient defines the control points that is used to specify how a gradient fill is displayed at the start and end of the shape morphing process.
Two or more control points are used to define how the colour changes across the gradient square.
Attributes | |
---|---|
startRatio | The location of the control point across the gradient square at the start of the morphing process. |
endRatio | The location of the control point across the gradient square at the end of the morphing process. |
startColor | The colour at the control point at the start of the morphing process. |
startColor | The colour at the control point at the end of the morphing process. |
The location of the control point is defined by a ratio - a number between 0 and 255 that specifies the relative location in the square. For Linear Gradient Fills a ratio of zero is mapped to the left side of the gradient square and 255 is mapped to the right side of the square. For Radial Gradient Fills a ratio of zero is mapped to the centre of the gradient square and 255 is mapped to the edge of the largest circle that fits inside the gradient square.
FSMorphGradients are only used in FSDefineMorphShape objects which support transparent colours so values for all the colour channels must be specified in the FSColor objects.
When the Flash Player displays the gradient control points they are sorted by the ratio with the FSGradient object with the smallest ratio value displayed first.
The FSMorphGradient class represents the MorphGradientRecord structure from the Macromedia Flash (SWF) File Format Specification. Shape morphing was introduced in Flash 3.
Constructor Summary | |
---|---|
FSMorphGradient(FSCoder coder)
Construct an FSMorphGradient object, initialising it with values decoded from an encoded object. |
|
FSMorphGradient(FSMorphGradient obj)
Constructs an FSMorphGradient object by copying values from an existing object. |
|
FSMorphGradient(int aStartRatio,
int anEndRatio,
FSColor aStartColor,
FSColor anEndColor)
Constructs an FSMorphGradient object specifying the starting and ending ratios and colours. |
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. |
FSColor |
getEndColor()
Gets the colour at the end of the morphing process. |
int |
getEndRatio()
Gets the ratio at the end of the morphing process. |
FSColor |
getStartColor()
Gets the colour at the start of the morphing process. |
int |
getStartRatio()
Gets the ratio at the start of the morphing process. |
int |
length(FSCoder coder)
|
void |
setEndColor(FSColor aColor)
Sets the colour at the end of the morphing process. |
void |
setEndRatio(int aNumber)
Sets the ratio along the gradient square at the end of the morphing process. |
void |
setStartColor(FSColor aColor)
Sets the colour at the start of the morphing process. |
void |
setStartRatio(int aNumber)
Sets the ratio along the gradient square at the start of the morphing process. |
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 FSMorphGradient(FSCoder coder)
coder
- an FSCoder containing the binary data.public FSMorphGradient(int aStartRatio, int anEndRatio, FSColor aStartColor, FSColor anEndColor)
aStartRatio
- the ratio along the gradient square at the start of the
morphing process.anEndRatio
- the ratio along the gradient square at the end of the morphing
process.aStartColor
- the colour at the starting control point.anEndColor
- the colour at the ending control point.public FSMorphGradient(FSMorphGradient obj)
obj
- an FSMorphGradient object.Method Detail |
---|
public int getStartRatio()
public int getEndRatio()
public FSColor getStartColor()
public FSColor getEndColor()
public void setStartRatio(int aNumber)
aNumber
- the starting ratio.public void setEndRatio(int aNumber)
aNumber
- the ending ratio.public void setStartColor(FSColor aColor)
aColor
- the start colour.public void setEndColor(FSColor aColor)
aColor
- the end colour.public java.lang.Object clone()
FSTransformObject
clone
in class FSTransformObject
public boolean equals(java.lang.Object anObject)
equals
in class FSTransformObject
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 FSTransformObject
public void encode(FSCoder coder)
encode
in class FSTransformObject
public void decode(FSCoder coder)
decode
in class FSTransformObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |