Class ArcTo
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:
- Since:
- JavaFX 2.0
Property Summary
| Type | Property | Description |
|---|---|---|
BooleanProperty | largeArcFlag | The large arc flag. |
DoubleProperty | radiusX | The horizontal radius to use for the arc. |
DoubleProperty | radiusY | The vertical radius to use for the arc. |
BooleanProperty | sweepFlag | The sweep flag |
DoubleProperty | XAxisRotation | The x-axis rotation in degrees. |
DoubleProperty | x | The x coordinate to arc to. |
DoubleProperty | y | The y coordinate to arc to. |
Properties declared in class javafx.scene.shape.PathElement
absolute
Constructor Summary
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
double | getRadiusX() | Gets the value of the property radiusX. |
double | getRadiusY() | Gets the value of the property radiusY. |
double | getX() | Gets the value of the property x. |
double | getXAxisRotation() | Gets the x-axis rotation in degrees. |
double | getY() | Gets the value of the property y. |
boolean | isLargeArcFlag() | Gets the value of the property largeArcFlag. |
boolean | isSweepFlag() | Gets the value of the property sweepFlag. |
BooleanProperty | largeArcFlagProperty() | The large arc flag. |
DoubleProperty | radiusXProperty() | The horizontal radius to use for the arc. |
DoubleProperty | radiusYProperty() | The vertical radius to use for the arc. |
void | setLargeArcFlag(boolean value) | Sets the value of the property largeArcFlag. |
void | setRadiusX(double value) | Sets the value of the property radiusX. |
void | setRadiusY(double value) | Sets the value of the property radiusY. |
void | setSweepFlag(boolean value) | Sets the value of the property sweepFlag. |
void | setX(double value) | Sets the value of the property x. |
void | setXAxisRotation(double value) | Sets the x-axis rotation in degrees. |
void | setY(double value) | Sets the value of the property y. |
BooleanProperty | sweepFlagProperty() | The sweep flag |
String | toString() | Returns a string representation of this ArcTo object. |
DoubleProperty | XAxisRotationProperty() | The x-axis rotation in degrees. |
DoubleProperty | xProperty() | The x coordinate to arc to. |
DoubleProperty | yProperty() | The y coordinate to arc to. |
Methods declared in class javafx.scene.shape.PathElement
absoluteProperty, isAbsolute, setAbsolute
Property Details
radiusX
public final DoubleProperty radiusXProperty
- Default value:
- 0.0
- See Also:
-
getRadiusX(),setRadiusX(double)
radiusY
public final DoubleProperty radiusYProperty
- Default value:
- 0.0
- See Also:
-
getRadiusY(),setRadiusY(double)
XAxisRotation
public final DoubleProperty XAxisRotationProperty
- See Also:
-
getXAxisRotation(),setXAxisRotation(double)
largeArcFlag
public final BooleanProperty largeArcFlagProperty
- Default value:
- false
- See Also:
-
isLargeArcFlag(),setLargeArcFlag(boolean)
sweepFlag
public final BooleanProperty sweepFlagProperty
- Default value:
- false
- See Also:
-
isSweepFlag(),setSweepFlag(boolean)
x
public final DoubleProperty xProperty
- Default value:
- 0.0
- See Also:
-
getX(),setX(double)
y
public final DoubleProperty yProperty
- Default value:
- 0.0
- See Also:
-
getY(),setY(double)
Constructor Details
ArcTo
public ArcTo()
ArcTo
public ArcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag)
- Parameters:
-
radiusX- horizontal radius of the arc -
radiusY- vertical radius of the arc -
xAxisRotation- the x-axis rotation in degrees -
x- horizontal position of the arc end point -
y- vertical position of the arc end point -
largeArcFlag- large arg flag: determines which arc to use (large/small) -
sweepFlag- sweep flag: determines which arc to use (direction)
Method Details
setRadiusX
public final void setRadiusX(double value)
- Property description:
- The horizontal radius to use for the arc.
- Default value:
- 0.0
getRadiusX
public final double getRadiusX()
- Property description:
- The horizontal radius to use for the arc.
- Default value:
- 0.0
radiusXProperty
public final DoubleProperty radiusXProperty()
- Default value:
- 0.0
- See Also:
-
getRadiusX(),setRadiusX(double)
setRadiusY
public final void setRadiusY(double value)
- Property description:
- The vertical radius to use for the arc.
- Default value:
- 0.0
getRadiusY
public final double getRadiusY()
- Property description:
- The vertical radius to use for the arc.
- Default value:
- 0.0
radiusYProperty
public final DoubleProperty radiusYProperty()
- Default value:
- 0.0
- See Also:
-
getRadiusY(),setRadiusY(double)
setXAxisRotation
public final void setXAxisRotation(double value)
- Parameters:
-
value- the x-axis rotation in degrees.
getXAxisRotation
public final double getXAxisRotation()
- Returns:
- the x-axis rotation in degrees.
XAxisRotationProperty
public final DoubleProperty XAxisRotationProperty()
- See Also:
-
getXAxisRotation(),setXAxisRotation(double)
setLargeArcFlag
public final void setLargeArcFlag(boolean value)
- Property description:
- The large arc flag.
- Default value:
- false
isLargeArcFlag
public final boolean isLargeArcFlag()
- Property description:
- The large arc flag.
- Default value:
- false
largeArcFlagProperty
public final BooleanProperty largeArcFlagProperty()
- Default value:
- false
- See Also:
-
isLargeArcFlag(),setLargeArcFlag(boolean)
setSweepFlag
public final void setSweepFlag(boolean value)
- Property description:
- The sweep flag
- Default value:
- false
isSweepFlag
public final boolean isSweepFlag()
- Property description:
- The sweep flag
- Default value:
- false
sweepFlagProperty
public final BooleanProperty sweepFlagProperty()
- Default value:
- false
- See Also:
-
isSweepFlag(),setSweepFlag(boolean)
setX
public final void setX(double value)
- Property description:
- The x coordinate to arc to.
- Default value:
- 0.0
getX
public final double getX()
- Property description:
- The x coordinate to arc to.
- Default value:
- 0.0
xProperty
public final DoubleProperty xProperty()
- Default value:
- 0.0
- See Also:
-
getX(),setX(double)
setY
public final void setY(double value)
- Property description:
- The y coordinate to arc to.
- Default value:
- 0.0
getY
public final double getY()
- Property description:
- The y coordinate to arc to.
- Default value:
- 0.0
yProperty
public final DoubleProperty yProperty()
- Default value:
- 0.0
- See Also:
-
getY(),setY(double)
toString
public String toString()
ArcTo object.- Overrides:
-
toStringin classObject - Returns:
- a string representation of this
ArcToobject.
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.