|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.fillstyle.FocalGradientFill
public final class FocalGradientFill
FocalGradientFill extends the functionality of GradientFill by allowing the focal point for the gradient to be specified rather than defaulting to the centre of the shape. The value for the focal point ranges from -1.0 to 1.0, where negative values up to -1.0 sets the focal point closer to the left border gradient circle and positive values up to 1.0 sets the focal point closer the right border. A value of zero means the focal point is in the centre.
| Constructor Summary | |
|---|---|
FocalGradientFill(CoordTransform matrix,
Spread spreadType,
Interpolation interpolationType,
float point,
List<Gradient> list)
Creates a GradientFill object specifying the type, coordinate transform and list of gradient points. |
|
FocalGradientFill(FocalGradientFill object)
Creates and initialises a FocalGradientFill fill style using the values copied from another FocalGradientFill object. |
|
FocalGradientFill(SWFDecoder coder,
Context context)
Creates and initialises a FocalGradientFill fill style using values encoded in the Flash binary format. |
|
| Method Summary | |
|---|---|
FocalGradientFill |
add(Gradient gradient)
Add a Gradient object to the list of gradient objects. |
FocalGradientFill |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
float |
getFocalPoint()
Get the focal point for the radial gradient. |
List<Gradient> |
getGradients()
Get the list of Gradient objects defining the points for the gradient fill. |
Interpolation |
getInterpolation()
Get the method used to calculate the colour changes across the gradient. |
Spread |
getSpread()
Get the Spread describing how the gradient fills the area: PAD - the last colour fills the remaining area; REPEAT - the gradient is repeated; REFLECT - the gradient is repeated but reflected (reversed) each time. |
CoordTransform |
getTransform()
Get the coordinate transform mapping the gradient square onto physical coordinates. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setFocalPoint(float point)
Set the focal point for the radial gradient. |
void |
setGradients(List<Gradient> list)
Sets the list of control points that define the gradient. |
void |
setInterpolation(Interpolation interpolationType)
Set the method used to calculate the colour changes across the gradient. |
void |
setSpread(Spread spreadType)
Set the Spread describing how the gradient fills the area: either by using the last gradient colour to fill the area (PAD); repeating the gradient (REPEAT) or repeating but reversing it each time (REFLECT). |
void |
setTransform(CoordTransform matrix)
Sets the coordinate transform mapping the gradient square onto physical coordinates. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FocalGradientFill(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 FocalGradientFill(CoordTransform matrix,
Spread spreadType,
Interpolation interpolationType,
float point,
List<Gradient> list)
matrix - the coordinate transform mapping the gradient square onto
physical coordinates. Must not be null.spreadType - To be documented.interpolationType - how the changes in colours across the gradient are calculated.point - the position of the focal point relative to the centre of the
radial circle. Values range from -1.0 (close to the left
edge), to 1.0 (close to the right edge).list - a list of Gradient objects defining the control points for
the gradient. For Flash 7 and earlier versions there can be up
to 8 Gradients. For Flash 8 onwards this number was increased
to 15. Must not be null.public FocalGradientFill(FocalGradientFill object)
object - a FocalGradientFill fill style from which the values will be
copied.| Method Detail |
|---|
public Spread getSpread()
public void setSpread(Spread spreadType)
spreadType - the Spread, either PAD, REFLECT or REPEAT.public Interpolation getInterpolation()
public void setInterpolation(Interpolation interpolationType)
interpolationType - the Interpolation that describes how colours change.public float getFocalPoint()
public void setFocalPoint(float point)
point - the focal point value in the range from -1.0 to 1.0.public FocalGradientFill add(Gradient gradient)
gradient - an Gradient object. Must not be null.
public List<Gradient> getGradients()
public void setGradients(List<Gradient> list)
list - a list of Gradient objects. Must not be null.public CoordTransform getTransform()
public void setTransform(CoordTransform matrix)
matrix - the coordinate transform. Must not be null.public FocalGradientFill copy()
copy in interface Copyable<FillStyle>public String toString()
toString in class Objectpublic int prepareToEncode(Context context)
prepareToEncode in interface SWFEncodeablecontext - 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 SWFEncodeablecoder - 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 | |||||||||