APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.shape

public Class CubicCurveTo

extends PathElement
Class Inheritance
Imports
com.sun.javafx.geom.Path2D, com.sun.javafx.scene.shape.CubicCurveToHelper, com.sun.javafx.sg.prism.NGPath, javafx.beans.property.DoubleProperty, .DoublePropertyBase

Creates a curved path element, defined by three new points, by drawing a Cubic Bézier curve that intersects both the current coordinates and the specified coordinates (x,y), using the specified points (controlX1,controlY1) and (controlX2,controlY2) as Bézier control points. All coordinates are specified in double precision.

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.0f);
moveTo.setY(0.0f);

CubicCurveTo cubicTo = new CubicCurveTo();
cubicTo.setControlX1(0.0f);
cubicTo.setControlY1(0.0f);
cubicTo.setControlX2(100.0f);
cubicTo.setControlY2(100.0f);
cubicTo.setX(100.0f);
cubicTo.setY(50.0f);

path.getElements().add(moveTo);
path.getElements().add(cubicTo);
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private DoubleProperty
controlX1

Defines the X coordinate of the first Bézier control point.

private DoubleProperty
controlX2

Defines the X coordinate of the second Bézier control point.

private DoubleProperty
controlY1

Defines the Y coordinate of the first Bézier control point.

private DoubleProperty
controlY2

Defines the Y coordinate of the second Bézier control point.

private DoubleProperty
x

Defines the X coordinate of the final end point.

private DoubleProperty
y

Defines the Y coordinate of the final end point.

Inherited from javafx.scene.shape.PathElement:
nodes

Constructor Summary

AccessConstructor and Description
public
CubicCurveTo()

Creates an empty instance of CubicCurveTo.

public
CubicCurveTo(double
the X coordinate of the first Bézier control point
controlX1
,
double
the Y coordinate of the first Bézier control point
controlY1
,
double
the X coordinate of the second Bézier control point
controlX2
,
double
the Y coordinate of the second Bézier control point
controlY2
,
double
the X coordinate of the final end point
x
,
double
the Y coordinate of the final end point
y
)

Creates a new instance of CubicCurveTo.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addTo(NGPath pgPath)

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

Adds the curved path element to the specified path.

public final DoubleProperty
public final DoubleProperty
public final DoubleProperty
public final DoubleProperty
private void
public final double
public final double
public final double
public final double
public final double
getX()

public final double
getY()

public final void
setControlX1(double value)

public final void
setControlX2(double value)

public final void
setControlY1(double value)

public final void
setControlY2(double value)

public final void
setX(double value)

public final void
setY(double value)

public String

Returns:

a string representation of this CubicCurveTo object.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this CubicCurveTo object.

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

Field Detail

controlX1back to summary
private DoubleProperty controlX1

Defines the X coordinate of the first Bézier control point.

Default Value
0.0
controlX2back to summary
private DoubleProperty controlX2

Defines the X coordinate of the second Bézier control point.

Default Value
0.0
controlY1back to summary
private DoubleProperty controlY1

Defines the Y coordinate of the first Bézier control point.

Default Value
0.0
controlY2back to summary
private DoubleProperty controlY2

Defines the Y coordinate of the second Bézier control point.

Default Value
0.0
xback to summary
private DoubleProperty x

Defines the X coordinate of the final end point.

Default Value
0.0
yback to summary
private DoubleProperty y

Defines the Y coordinate of the final end point.

Default Value
0.0

Constructor Detail

CubicCurveToback to summary
public CubicCurveTo()

Creates an empty instance of CubicCurveTo.

CubicCurveToback to summary
public CubicCurveTo(double controlX1, double controlY1, double controlX2, double controlY2, double x, double y)

Creates a new instance of CubicCurveTo.

Parameters
controlX1:double

the X coordinate of the first Bézier control point

controlY1:double

the Y coordinate of the first Bézier control point

controlX2:double

the X coordinate of the second Bézier control point

controlY2:double

the Y coordinate of the second Bézier control point

x:double

the X coordinate of the final end point

y:double

the Y coordinate of the final end point

Method Detail

addToback to summary
pack-priv void addTo(NGPath pgPath)

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

Adds the curved path element to the specified path.

Annotations
@Override
controlX1Propertyback to summary
public final DoubleProperty controlX1Property()
controlX2Propertyback to summary
public final DoubleProperty controlX2Property()
controlY1Propertyback to summary
public final DoubleProperty controlY1Property()
controlY2Propertyback to summary
public final DoubleProperty controlY2Property()
doAddToback to summary
private void doAddTo(Path2D path)
getControlX1back to summary
public final double getControlX1()
getControlX2back to summary
public final double getControlX2()
getControlY1back to summary
public final double getControlY1()
getControlY2back to summary
public final double getControlY2()
getXback to summary
public final double getX()
getYback to summary
public final double getY()
setControlX1back to summary
public final void setControlX1(double value)
setControlX2back to summary
public final void setControlX2(double value)
setControlY1back to summary
public final void setControlY1(double value)
setControlY2back to summary
public final void setControlY2(double value)
setXback to summary
public final void setX(double value)
setYback to summary
public final void setY(double value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this CubicCurveTo object.

Returns:String

a string representation of this CubicCurveTo object.

Annotations
@Override
xPropertyback to summary
public final DoubleProperty xProperty()
yPropertyback to summary
public final DoubleProperty yProperty()