public class ArcTo extends PathElement
For more information on path elements see the Path
and
PathElement
classes.
Example:
import javafx.scene.shape.*; Path path = new Path(); MoveTo moveTo = new MoveTo(); moveTo.setX(0.0); moveTo.setY(0.0); ArcTo arcTo = new ArcTo(); arcTo.setX(50.0); arcTo.setY(50.0); arcTo.setRadiusX(50.0); arcTo.setRadiusY(50.0); path.getElements().add(moveTo); path.getElements().add(arcTo);
Following image demonstrates radiusX
, radiusY
and
xAxisRotation
parameters:
radiusX
is the horizontal radius of the full ellipse of which this arc is
a partial section, radiusY
is its vertical radius.
xAxisRotation
defines the rotation of the ellipse in degrees.
In most cases, there are four options of how to draw an arc from
starting point to given end coordinates. They can be distinguished by
largeArcFlag
and sweepFlag
parameters.
largeArcFlag == true
means that the arc greater than 180 degrees will
be drawn. sweepFlag == true
means that the arc will be drawn
in the positive angle direction - i.e. the angle in the
ellipse formula will increase from [fromX, fromY]
to [x,y]
.
Following images demonstrate this behavior:
Constructor and Description |
---|
ArcTo()
Creates an empty instance of ArcTo.
|
ArcTo(double radiusX,
double radiusY,
double xAxisRotation,
double x,
double y,
boolean largeArcFlag,
boolean sweepFlag)
Creates a new instance of ArcTo.
|
Modifier and Type | Method and Description |
---|---|
double |
getRadiusX() |
double |
getRadiusY() |
double |
getX() |
double |
getXAxisRotation()
Gets the x-axis rotation in degrees.
|
double |
getY() |
void |
impl_addTo(Path2D path)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
boolean |
isLargeArcFlag() |
boolean |
isSweepFlag() |
BooleanProperty |
largeArcFlagProperty() |
DoubleProperty |
radiusXProperty() |
DoubleProperty |
radiusYProperty() |
void |
setLargeArcFlag(boolean value) |
void |
setRadiusX(double value) |
void |
setRadiusY(double value) |
void |
setSweepFlag(boolean value) |
void |
setX(double value) |
void |
setXAxisRotation(double value)
Sets the x-axis rotation in degrees.
|
void |
setY(double value) |
BooleanProperty |
sweepFlagProperty() |
String |
toString()
Returns a string representation of this
ArcTo object. |
DoubleProperty |
XAxisRotationProperty()
The x-axis rotation in degrees.
|
DoubleProperty |
xProperty() |
DoubleProperty |
yProperty() |
absoluteProperty, isAbsolute, setAbsolute
public ArcTo()
public ArcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag)
radiusX
- horizontal radius of the arcradiusY
- vertical radius of the arcxAxisRotation
- the x-axis rotation in degreesx
- horizontal position of the arc end pointy
- vertical position of the arc end pointlargeArcFlag
- large arg flag: determines which arc to use (large/small)sweepFlag
- sweep flag: determines which arc to use (direction)public final void setRadiusX(double value)
public final double getRadiusX()
public final DoubleProperty radiusXProperty()
public final void setRadiusY(double value)
public final double getRadiusY()
public final DoubleProperty radiusYProperty()
public final void setXAxisRotation(double value)
value
- the x-axis rotation in degrees.public final double getXAxisRotation()
public final DoubleProperty XAxisRotationProperty()
public final void setLargeArcFlag(boolean value)
public final boolean isLargeArcFlag()
public final BooleanProperty largeArcFlagProperty()
public final void setSweepFlag(boolean value)
public final boolean isSweepFlag()
public final BooleanProperty sweepFlagProperty()
public final void setX(double value)
public final double getX()
public final DoubleProperty xProperty()
public final void setY(double value)
public final double getY()
public final DoubleProperty yProperty()
@Deprecated public void impl_addTo(Path2D path)
impl_addTo
in class PathElement
Copyright © 2020. All rights reserved.