public class Circle extends Shape
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);
Type | Property and Description |
---|---|
DoubleProperty |
centerX
Defines the horizontal position of the center of the circle in pixels.
|
DoubleProperty |
centerY
Defines the vertical position of the center of the circle in pixels.
|
DoubleProperty |
radius
Defines the radius of the circle in pixels.
|
fillProperty, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty
Modifier and Type | Field 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 DoubleProperty |
radius
Defines the radius of the circle in pixels.
|
private Ellipse2D |
shape |
old_fill, old_stroke
Constructor and Description |
---|
Circle()
Creates an empty instance of Circle.
|
Circle(double radius)
Creates a new instance of Circle with a specified radius.
|
Circle(double centerX,
double centerY,
double radius)
Creates a new instance of Circle with a specified position and radius.
|
Circle(double centerX,
double centerY,
double radius,
Paint fill)
Creates a new instance of Circle with a specified position, radius and fill.
|
Circle(double radius,
Paint fill)
Creates a new instance of Circle with a specified radius and fill.
|
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
centerXProperty()
Defines the horizontal position of the center of the circle in pixels.
|
DoubleProperty |
centerYProperty()
Defines the vertical position of the center of the circle in pixels.
|
(package private) StrokeLineJoin |
convertLineJoin(StrokeLineJoin t) |
private BaseBounds |
doComputeGeomBounds(BaseBounds bounds,
BaseTransform tx) |
private Ellipse2D |
doConfigShape() |
private NGNode |
doCreatePeer() |
private void |
doUpdatePeer() |
double |
getCenterX()
Gets the value of the property centerX.
|
double |
getCenterY()
Gets the value of the property centerY.
|
double |
getRadius()
Gets the value of the property radius.
|
DoubleProperty |
radiusProperty()
Defines the radius of the circle in pixels.
|
void |
setCenterX(double value)
Sets the value of the property centerX.
|
void |
setCenterY(double value)
Sets the value of the property centerY.
|
void |
setRadius(double value)
Sets the value of the property radius.
|
java.lang.String |
toString()
Returns a string representation of this
Circle object. |
computeBounds, computeShapeBounds, computeShapeContains, fillProperty, getClassCssMetaData, getCssMetaData, getFill, getMode, getStroke, getStrokeDashArray, getStrokeDashOffset, getStrokeLineCap, getStrokeLineJoin, getStrokeMiterLimit, getStrokeType, getStrokeWidth, intersect, isSmooth, setFill, setMode, setShapeChangeListener, setSmooth, setStroke, setStrokeDashOffset, setStrokeLineCap, setStrokeLineJoin, setStrokeMiterLimit, setStrokeType, setStrokeWidth, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract, union
public final DoubleProperty centerXProperty
getCenterX()
,
setCenterX(double)
public final DoubleProperty centerYProperty
getCenterY()
,
setCenterY(double)
public final DoubleProperty radiusProperty
getRadius()
,
setRadius(double)
private final Ellipse2D shape
private DoubleProperty centerX
private DoubleProperty centerY
private final DoubleProperty radius
public Circle(double radius)
radius
- the radius of the circle in pixelspublic Circle(double radius, Paint fill)
radius
- the radius of the circlefill
- determines how to fill the interior of the Circlepublic Circle()
public Circle(double centerX, double centerY, double radius)
centerX
- the horizontal position of the center of the circle in pixelscenterY
- the vertical position of the center of the circle in pixelsradius
- the radius of the circle in pixelspublic Circle(double centerX, double centerY, double radius, Paint fill)
centerX
- the horizontal position of the center of the circle in pixelscenterY
- the vertical position of the center of the circle in pixelsradius
- the radius of the circle in pixelsfill
- determines how to fill the interior of the Circlepublic final void setCenterX(double value)
public final double getCenterX()
public final DoubleProperty centerXProperty()
getCenterX()
,
setCenterX(double)
public final void setCenterY(double value)
public final double getCenterY()
public final DoubleProperty centerYProperty()
getCenterY()
,
setCenterY(double)
public final void setRadius(double value)
public final double getRadius()
public final DoubleProperty radiusProperty()
getRadius()
,
setRadius(double)
StrokeLineJoin convertLineJoin(StrokeLineJoin t)
convertLineJoin
in class Shape
private NGNode doCreatePeer()
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)
private Ellipse2D doConfigShape()
private void doUpdatePeer()
public java.lang.String toString()
Circle
object.Circle
object.