Top Description Fields Constructors Methods
javafx.scene.shape

public Class ArcTo

extends PathElement
Class Inheritance
Imports
com.sun.javafx.geom.Arc2D, .Path2D, .PathIterator, com.sun.javafx.geom.transform.BaseTransform, com.sun.javafx.scene.shape.ArcToHelper, com.sun.javafx.sg.prism.NGPath, javafx.beans.property.BooleanProperty, .BooleanPropertyBase, .DoubleProperty, .DoublePropertyBase

A path element that forms an arc from the previous coordinates to the specified x and y coordinates using the specified radius.

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.

A visual rendering of ArcTo shape

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:

A visual rendering of ArcTo shape
 with setting to its different properties

Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private BooleanProperty
largeArcFlag

The large arc flag.

private DoubleProperty
radiusX

The horizontal radius to use for the arc.

private DoubleProperty
radiusY

The vertical radius to use for the arc.

private BooleanProperty
sweepFlag

The sweep flag

private DoubleProperty
x

The x coordinate to arc to.

private DoubleProperty
xAxisRotation

The x-axis rotation in degrees.

private DoubleProperty
y

The y coordinate to arc to.

Inherited from javafx.scene.shape.PathElement:
nodes

Constructor Summary

AccessConstructor and Description
public
ArcTo()

Creates an empty instance of ArcTo.

public
ArcTo(double
horizontal radius of the arc
radiusX
,
double
vertical radius of the arc
radiusY
,
double
the x-axis rotation in degrees
xAxisRotation
,
double
horizontal position of the arc end point
x
,
double
vertical position of the arc end point
y
,
boolean
large arg flag: determines which arc to use (large/small)
largeArcFlag
,
boolean
sweep flag: determines which arc to use (direction)
sweepFlag
)

Creates a new instance of ArcTo.

Method Summary

Modifier and TypeMethod and Description
private void
addArcTo(NGPath pgPath, Path2D path, final double x0, final double y0)

pack-priv void
private void
public final double
public final double
public final double
getX()

public final double

Returns:

the x-axis rotation in degrees.
getXAxisRotation
()

Gets the x-axis rotation in degrees.

public final double
getY()

public final boolean
public final boolean
public final BooleanProperty
public final DoubleProperty
public final DoubleProperty
public final void
setLargeArcFlag(boolean value)

public final void
setRadiusX(double value)

public final void
setRadiusY(double value)

public final void
setSweepFlag(boolean value)

public final void
setX(double value)

public final void
setXAxisRotation(double
the x-axis rotation in degrees.
value
)

Sets the x-axis rotation in degrees.

public final void
setY(double value)

public final BooleanProperty
public String

Returns:

a string representation of this ArcTo object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this ArcTo object.

public final DoubleProperty

Returns:

The XAxisRotation property
XAxisRotationProperty
()

The x-axis rotation in degrees.

public final DoubleProperty
public final DoubleProperty
Inherited from javafx.scene.shape.PathElement:
absolutePropertyaddNodeisAbsoluteremoveNodesetAbsoluteu

Field Detail

largeArcFlagback to summary
private BooleanProperty largeArcFlag

The large arc flag.

Default Value
false
radiusXback to summary
private DoubleProperty radiusX

The horizontal radius to use for the arc.

Default Value
0.0
radiusYback to summary
private DoubleProperty radiusY

The vertical radius to use for the arc.

Default Value
0.0
sweepFlagback to summary
private BooleanProperty sweepFlag

The sweep flag

Default Value
false
xback to summary
private DoubleProperty x

The x coordinate to arc to.

Default Value
0.0
xAxisRotationback to summary
private DoubleProperty xAxisRotation

The x-axis rotation in degrees.

Default Value
0.0
yback to summary
private DoubleProperty y

The y coordinate to arc to.

Default Value
0.0

Constructor Detail

ArcToback to summary
public ArcTo()

Creates an empty instance of ArcTo.

ArcToback to summary
public ArcTo(double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag)

Creates a new instance of ArcTo.

Parameters
radiusX:double

horizontal radius of the arc

radiusY:double

vertical radius of the arc

xAxisRotation:double

the x-axis rotation in degrees

x:double

horizontal position of the arc end point

y:double

vertical position of the arc end point

largeArcFlag:boolean

large arg flag: determines which arc to use (large/small)

sweepFlag:boolean

sweep flag: determines which arc to use (direction)

Method Detail

addArcToback to summary
private void addArcTo(NGPath pgPath, Path2D path, final double x0, final double y0)
addToback to summary
pack-priv void addTo(NGPath pgPath)

Implements abstract javafx.scene.shape.PathElement.addTo.

Annotations
@Override
doAddToback to summary
private void doAddTo(Path2D path)
getRadiusXback to summary
public final double getRadiusX()
getRadiusYback to summary
public final double getRadiusY()
getXback to summary
public final double getX()
getXAxisRotationback to summary
public final double getXAxisRotation()

Gets the x-axis rotation in degrees.

Returns:double

the x-axis rotation in degrees.

getYback to summary
public final double getY()
isLargeArcFlagback to summary
public final boolean isLargeArcFlag()
isSweepFlagback to summary
public final boolean isSweepFlag()
largeArcFlagPropertyback to summary
public final BooleanProperty largeArcFlagProperty()
radiusXPropertyback to summary
public final DoubleProperty radiusXProperty()
radiusYPropertyback to summary
public final DoubleProperty radiusYProperty()
setLargeArcFlagback to summary
public final void setLargeArcFlag(boolean value)
setRadiusXback to summary
public final void setRadiusX(double value)
setRadiusYback to summary
public final void setRadiusY(double value)
setSweepFlagback to summary
public final void setSweepFlag(boolean value)
setXback to summary
public final void setX(double value)
setXAxisRotationback to summary
public final void setXAxisRotation(double value)

Sets the x-axis rotation in degrees.

Parameters
value:double

the x-axis rotation in degrees.

setYback to summary
public final void setY(double value)
sweepFlagPropertyback to summary
public final BooleanProperty sweepFlagProperty()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this ArcTo object.

Returns:String

a string representation of this ArcTo object.

Annotations
@Override
XAxisRotationPropertyback to summary
public final DoubleProperty XAxisRotationProperty()

The x-axis rotation in degrees.

Returns:DoubleProperty

The XAxisRotation property

xPropertyback to summary
public final DoubleProperty xProperty()
yPropertyback to summary
public final DoubleProperty yProperty()