
public class CurveTo extends EndPointCommand
PathCommand that represents a cubic Bézier segment.| Modifier and Type | Field and Description |
|---|---|
protected double |
x1 |
protected double |
x2 |
protected double |
y1 |
protected double |
y2 |
x, yrelative| Constructor and Description |
|---|
CurveTo()
Creates a curve
PathCommand. |
CurveTo(CurveTo curveto)
Creates a copy of the given curve
PathCommand. |
CurveTo(double x1,
double y1,
double x2,
double y2,
double x,
double y)
Creates a curve
PathCommand with the given points. |
CurveTo(double x1,
double y1,
double x2,
double y2,
double x,
double y,
boolean relative)
Creates a curve
PathCommand with the given points. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendTo(StringBuilder build) |
CurveTo |
copy()
Returns a copy of the path command.
|
double |
getX1()
Returns the x-coordinate of the beginning control point of the curve.
|
double |
getX2()
Returns the x-coordinate of the ending control point of the curve
|
double |
getY1()
Returns the y-coordinate of the beginning control point of the curve.
|
double |
getY2()
Returns the y-coordinate of the ending control point of the curve
|
boolean |
nearEqual(PathCommand command)
Determines equality of two commands using rounded values.
|
void |
setX1(double x1)
Sets the x-coordinate of the beginning control point of the curve.
|
void |
setX2(double x2)
Sets the x-coordinate of the ending control point of the curve.
|
void |
setY1(double y1)
Sets the y-coordinate of the beginning control point of the curve.
|
void |
setY2(double y2)
Sets the y-coordinate of the ending control point of the curve.
|
void |
toAbsolute(PrecisePoint currentPoint,
PrecisePoint movePoint)
Converts the path commands to absolute coordinates using the given frame of
reference and the last move.
|
List<PathCommand> |
toCurve(PrecisePoint currentPoint,
PrecisePoint movePoint,
PrecisePoint curvePoint,
PrecisePoint quadraticPoint)
Converts the
PathCommand to a CurveTo command. |
String |
toString() |
getX, getY, setX, setYisRelative, setRelativeprotected double x1
protected double y1
protected double x2
protected double y2
public CurveTo()
PathCommand. Defaults to absolute.public CurveTo(CurveTo curveto)
PathCommand.curveto - the curve to copypublic CurveTo(double x1,
double y1,
double x2,
double y2,
double x,
double y)
PathCommand with the given points. Defaults to
absolute.x1 - the x-coordinate of the beginning control point of the curvey1 - the y-coordinate of the beginning control point of the curvex2 - the x-coordinate of the ending control point of the curvey2 - the y-coordinate of the ending control point of the curvex - the x-coordinate of the end of the segmenty - the y-coordinate of the end of the segmentpublic CurveTo(double x1,
double y1,
double x2,
double y2,
double x,
double y,
boolean relative)
PathCommand with the given points.x1 - the x-coordinate of the beginning control point of the curvey1 - the y-coordinate of the beginning control point of the curvex2 - the x-coordinate of the ending control point of the curvey2 - the y-coordinate of the ending control point of the curvex - the x-coordinate of the end of the segmenty - the y-coordinate of the end of the segmentrelative - true if the command is relativepublic CurveTo copy()
PathCommandcopy in class PathCommandpublic double getX1()
public double getX2()
public double getY1()
public double getY2()
public boolean nearEqual(PathCommand command)
PathCommandnearEqual in class PathCommandcommand - the command to comparepublic void setX1(double x1)
x1 - the x-coordinate of the beginning control point of the curvepublic void setX2(double x2)
x2 - the x-coordinate of the ending control point of the curvepublic void setY1(double y1)
y1 - the y-coordinate of the beginning control point of the curvepublic void setY2(double y2)
y2 - the y-coordinate of the ending control point of the curvepublic void toAbsolute(PrecisePoint currentPoint, PrecisePoint movePoint)
PathCommandtoAbsolute in class EndPointCommandcurrentPoint - frame of referencemovePoint - last move pointpublic List<PathCommand> toCurve(PrecisePoint currentPoint, PrecisePoint movePoint, PrecisePoint curvePoint, PrecisePoint quadraticPoint)
PathCommandPathCommand to a CurveTo command. If a
MoveTo no conversion takes place, but the current move point is
updated.toCurve in class PathCommandcurrentPoint - the current point of the pathmovePoint - the frame of reference for the pathcurvePoint - the frame of reference for the BézierquadraticPoint - the beginning of the last quadratic curvepublic void appendTo(StringBuilder build)
appendTo in class PathCommandCopyright © 2018. All rights reserved.