|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.flagstone.transform.shape.Curve
public final class Curve
Curve is used to define a curve. Curved lines are constructed using a Quadratic Bezier curve. The curve is specified using two points, an off-curve control point, relative to the current point and an on-curve anchor point which defines the end-point of the curve, and which is specified relative to the anchor point.
Flash does not directly support Cubic Bezier curves. Converting a Cubic Bezier curve to a Quadratic curve is a non trivial process, however the Canvas class contains a method to perform the conversion simplifying the create of Shape outlines in Flash from other graphics formats.
Canvas
Constructor Summary | |
---|---|
Curve(Curve object)
Creates and initialises a Curve object using the values copied from another Curve object. |
|
Curve(int xControl,
int yControl,
int xAnchor,
int yAnchor)
Creates a Curve object specifying the anchor and control point coordinates. |
|
Curve(SWFDecoder coder)
Creates and initialises a Curve object using values encoded in the Flash binary format. |
Method Summary | |
---|---|
Curve |
copy()
Creates a complete copy of this object. |
void |
encode(SWFEncoder coder,
Context context)
Encode an object to the Flash binary format. |
int |
getAnchorX()
Get the x-coordinate of the anchor point relative to the control point. |
int |
getAnchorY()
Get the y-coordinate of the anchor point relative to the control point. |
int |
getControlX()
Get the x-coordinate of the control point relative to the current drawing point. |
int |
getControlY()
Get the y-coordinate of the control point relative to the current drawing point. |
int |
prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. |
void |
setPoints(int xControl,
int yControl,
int xAnchor,
int yAnchor)
Sets the x and y coordinates of the control and anchor points. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Curve(SWFDecoder coder) throws IOException
coder
- an SWFDecoder object that contains the encoded Flash data.
IOException
- if an error occurs while decoding the data.public Curve(int xControl, int yControl, int xAnchor, int yAnchor)
xControl
- the x-coordinate of the control point, specified relative to
the current drawing point. Must be in the range -65535..65535.yControl
- the y-coordinate of the control point, specified relative to
the current drawing point.Must be in the range -65535..65535.xAnchor
- the x-coordinate of the anchor point, specified relative to
the control point.Must be in the range -65535..65535.yAnchor
- the y-coordinate of the anchor point, specified relative to
the control point.Must be in the range -65535..65535.public Curve(Curve object)
object
- a Curve object from which the values will be
copied.Method Detail |
---|
public int getControlX()
public int getControlY()
public int getAnchorX()
public int getAnchorY()
public void setPoints(int xControl, int yControl, int xAnchor, int yAnchor)
xControl
- the x-coordinate of the control point.yControl
- the y-coordinate of the control point.xAnchor
- the x-coordinate of the anchor point.yAnchor
- the y-coordinate of the anchor point.public Curve 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 |