Class Circle

All Implemented Interfaces:
Styleable, EventTarget

public class Circle extends Shape
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
  • Property Details

  • Constructor Details

    • Circle

      public Circle(double radius)
      Creates a new instance of Circle with a specified radius.
      Parameters:
      radius - the radius of the circle in pixels
    • Circle

      public Circle(double radius, Paint fill)
      Creates a new instance of Circle with a specified radius and fill.
      Parameters:
      radius - the radius of the circle
      fill - determines how to fill the interior of the Circle
    • Circle

      public Circle()
      Creates an empty instance of Circle.
    • Circle

      public Circle(double centerX, double centerY, double radius)
      Creates a new instance of Circle with a specified position and radius.
      Parameters:
      centerX - the horizontal position of the center of the circle in pixels
      centerY - the vertical position of the center of the circle in pixels
      radius - the radius of the circle in pixels
    • Circle

      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 - the horizontal position of the center of the circle in pixels
      centerY - the vertical position of the center of the circle in pixels
      radius - the radius of the circle in pixels
      fill - determines how to fill the interior of the Circle
  • Method Details

    • setCenterX

      public final void setCenterX(double value)
      Sets the value of the property centerX.
      Property description:
      Defines the horizontal position of the center of the circle in pixels.
      Default value:
      0.0
    • getCenterX

      public final double getCenterX()
      Gets the value of the property centerX.
      Property description:
      Defines the horizontal position of the center of the circle in pixels.
      Default value:
      0.0
    • centerXProperty

      public final DoubleProperty centerXProperty()
      Defines the horizontal position of the center of the circle in pixels.
      Default value:
      0.0
      See Also:
    • setCenterY

      public final void setCenterY(double value)
      Sets the value of the property centerY.
      Property description:
      Defines the vertical position of the center of the circle in pixels.
      Default value:
      0.0
    • getCenterY

      public final double getCenterY()
      Gets the value of the property centerY.
      Property description:
      Defines the vertical position of the center of the circle in pixels.
      Default value:
      0.0
    • centerYProperty

      public final DoubleProperty centerYProperty()
      Defines the vertical position of the center of the circle in pixels.
      Default value:
      0.0
      See Also:
    • setRadius

      public final void setRadius(double value)
      Sets the value of the property radius.
      Property description:
      Defines the radius of the circle in pixels.
      Default value:
      0.0
    • getRadius

      public final double getRadius()
      Gets the value of the property radius.
      Property description:
      Defines the radius of the circle in pixels.
      Default value:
      0.0
    • radiusProperty

      public final DoubleProperty radiusProperty()
      Defines the radius of the circle in pixels.
      Default value:
      0.0
      See Also:
    • toString

      public String toString()
      Returns a string representation of this Circle object.
      Overrides:
      toString in class Node
      Returns:
      a string representation of this Circle object.