Class Circle

All Implemented Interfaces:
Styleable, EventTarget

public non-sealed 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 centerX property.
      Property description:
      Defines the horizontal position of the center of the circle in pixels.
      Default value:
      0.0
      Parameters:
      value - the value for the centerX property
      See Also:
    • getCenterX

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

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

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

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

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

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

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

      public final DoubleProperty radiusProperty()
      Defines the radius of the circle in pixels.
      Default value:
      0.0
      Returns:
      the radius property
      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.