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

public non-sealed Class Circle

extends Shape
Class Inheritance
Imports
com.sun.javafx.geom.BaseBounds, .Ellipse2D, com.sun.javafx.geom.transform.BaseTransform, com.sun.javafx.scene.DirtyBits, .NodeHelper, com.sun.javafx.scene.shape.CircleHelper, .ShapeHelper, com.sun.javafx.sg.prism.NGCircle, .NGNode, .NGShape, javafx.beans.property.DoubleProperty, .DoublePropertyBase, javafx.scene.Node, javafx.scene.paint.Paint

The Circle class creates a new circle with the specified radius and center location measured in pixels.

Example usage. The following code creates a circle with radius of 50 pixels centered at (100,100).

import javafx.scene.shape.Circle;

Circle circle = new Circle();
circle.setCenterX(100.0f);
circle.setCenterY(100.0f);
circle.setRadius(50.0f);
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private DoubleProperty
centerX

Defines the horizontal position of the center of the circle in pixels.

private DoubleProperty
centerY

Defines the vertical position of the center of the circle in pixels.

private final DoubleProperty
radius

Defines the radius of the circle in pixels.

private final Ellipse2D
Inherited from javafx.scene.shape.Shape:
old_fillold_stroke

Constructor Summary

AccessConstructor and Description
public
Circle(double
the radius of the circle in pixels
radius
)

Creates a new instance of Circle with a specified radius.

public
Circle(double
the radius of the circle
radius
,
Paint
determines how to fill the interior of the Circle
fill
)

Creates a new instance of Circle with a specified radius and fill.

public
Circle()

Creates an empty instance of Circle.

public
Circle(double
the horizontal position of the center of the circle in pixels
centerX
,
double
the vertical position of the center of the circle in pixels
centerY
,
double
the radius of the circle in pixels
radius
)

Creates a new instance of Circle with a specified position and radius.

public
Circle(double
the horizontal position of the center of the circle in pixels
centerX
,
double
the vertical position of the center of the circle in pixels
centerY
,
double
the radius of the circle in pixels
radius
,
Paint
determines how to fill the interior of the Circle
fill
)

Creates a new instance of Circle with a specified position, radius and fill.

Method Summary

Modifier and TypeMethod and Description
public final DoubleProperty
public final DoubleProperty
pack-priv StrokeLineJoin
private BaseBounds
private Ellipse2D
private NGNode
private void
public final double
public final double
public final double
public final DoubleProperty
public final void
setCenterX(double value)

public final void
setCenterY(double value)

public final void
setRadius(double value)

public String

Returns:

a string representation of this Circle object.
toString
()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Circle object.

Inherited from javafx.scene.shape.Shape:
computeBoundscomputeShapeBoundscomputeShapeContainsfillPropertygetClassCssMetaDatagetCssMetaDatagetFillgetModegetStrokegetStrokeDashArraygetStrokeDashOffsetgetStrokeLineCapgetStrokeLineJoingetStrokeMiterLimitgetStrokeTypegetStrokeWidthintersectisSmoothsetFillsetShapeChangeListenersetSmoothsetStrokesetStrokeDashOffsetsetStrokeLineCapsetStrokeLineJoinsetStrokeMiterLimitsetStrokeTypesetStrokeWidthsmoothPropertystrokeDashOffsetPropertystrokeLineCapPropertystrokeLineJoinPropertystrokeMiterLimitPropertystrokePropertystrokeTypePropertystrokeWidthPropertysubtractunion

Field Detail

centerXback to summary
private DoubleProperty centerX

Defines the horizontal position of the center of the circle in pixels.

Default Value
0.0
centerYback to summary
private DoubleProperty centerY

Defines the vertical position of the center of the circle in pixels.

Default Value
0.0
radiusback to summary
private final DoubleProperty radius

Defines the radius of the circle in pixels.

Default Value
0.0
shapeback to summary
private final Ellipse2D shape

Constructor Detail

Circleback to summary
public Circle(double radius)

Creates a new instance of Circle with a specified radius.

Parameters
radius:double

the radius of the circle in pixels

Circleback to summary
public Circle(double radius, Paint fill)

Creates a new instance of Circle with a specified radius and fill.

Parameters
radius:double

the radius of the circle

fill:Paint

determines how to fill the interior of the Circle

Circleback to summary
public Circle()

Creates an empty instance of Circle.

Circleback to summary
public Circle(double centerX, double centerY, double radius)

Creates a new instance of Circle with a specified position and radius.

Parameters
centerX:double

the horizontal position of the center of the circle in pixels

centerY:double

the vertical position of the center of the circle in pixels

radius:double

the radius of the circle in pixels

Circleback to summary
public Circle(double centerX, double centerY, double radius, Paint fill)

Creates a new instance of Circle with a specified position, radius and fill.

Parameters
centerX:double

the horizontal position of the center of the circle in pixels

centerY:double

the vertical position of the center of the circle in pixels

radius:double

the radius of the circle in pixels

fill:Paint

determines how to fill the interior of the Circle

Method Detail

centerXPropertyback to summary
public final DoubleProperty centerXProperty()
centerYPropertyback to summary
public final DoubleProperty centerYProperty()
convertLineJoinback to summary
pack-priv StrokeLineJoin convertLineJoin(StrokeLineJoin t)

Overrides javafx.scene.shape.Shape.convertLineJoin.

Annotations
@Override
doComputeGeomBoundsback to summary
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)

Hides javafx.scene.shape.Shape.doComputeGeomBounds.

doConfigShapeback to summary
private Ellipse2D doConfigShape()
doCreatePeerback to summary
private NGNode doCreatePeer()
doUpdatePeerback to summary
private void doUpdatePeer()

Hides javafx.scene.shape.Shape.doUpdatePeer.

getCenterXback to summary
public final double getCenterX()
getCenterYback to summary
public final double getCenterY()
getRadiusback to summary
public final double getRadius()
radiusPropertyback to summary
public final DoubleProperty radiusProperty()
setCenterXback to summary
public final void setCenterX(double value)
setCenterYback to summary
public final void setCenterY(double value)
setRadiusback to summary
public final void setRadius(double value)
toStringback to summary
public String toString()

Overrides javafx.scene.Node.toString.

Returns a string representation of this Circle object.

Returns:String

a string representation of this Circle object.

Annotations
@Override