public class LineToHorizontal extends PathCommand
PathCommand
that represents a horizontal line.Constructor and Description |
---|
LineToHorizontal()
Creates a horizontal line
PathCommand . |
LineToHorizontal(double x)
Creates a horizontal line
PathCommand using the given coordinates. |
LineToHorizontal(double x,
boolean relative)
Creates a horizontal line
PathCommand using the given coordinates. |
LineToHorizontal(LineToHorizontal horizontal)
Creates a copy of the given horizontal line
PathCommand . |
Modifier and Type | Method and Description |
---|---|
void |
appendTo(StringBuilder build) |
LineToHorizontal |
copy()
Returns a copy of the path command.
|
double |
getX()
Returns the x-coordinate of the end point of the command.
|
boolean |
nearEqual(PathCommand command)
Determines equality of two commands using rounded values.
|
void |
setX(double x)
Sets the x-coordinate of the end point of the command.
|
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() |
isRelative, setRelative
public LineToHorizontal()
PathCommand
. Defaults to absolute.public LineToHorizontal(double x)
PathCommand
using the given coordinates.
Defaults to absolute.x
- the x-coordinate of the end point of the linepublic LineToHorizontal(double x, boolean relative)
PathCommand
using the given coordinates.x
- the x-coordinate of the end point of the linerelative
- true if the command is relativepublic LineToHorizontal(LineToHorizontal horizontal)
PathCommand
.horizontal
- the command to be copiedpublic LineToHorizontal copy()
PathCommand
copy
in class PathCommand
public double getX()
public boolean nearEqual(PathCommand command)
PathCommand
nearEqual
in class PathCommand
command
- the command to comparepublic void setX(double x)
x
- the x-coordinate of the end point of the commandpublic void toAbsolute(PrecisePoint currentPoint, PrecisePoint movePoint)
PathCommand
toAbsolute
in class PathCommand
currentPoint
- frame of referencemovePoint
- last move pointpublic List<PathCommand> toCurve(PrecisePoint currentPoint, PrecisePoint movePoint, PrecisePoint curvePoint, PrecisePoint quadraticPoint)
PathCommand
PathCommand
to a CurveTo
command. If a
MoveTo
no conversion takes place, but the current move point is
updated.toCurve
in class PathCommand
currentPoint
- 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 PathCommand
Copyright © 2015. All rights reserved.