Class Arc

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class Arc
    extends Shape
    The Arc class represents a 2D arc object, defined by a center point, start angle (in degrees), angular extent (length of the arc in degrees), and an arc type (ArcType.OPEN, ArcType.CHORD, or ArcType.ROUND).

    Example usage: the following code creates an Arc which is centered around 50,50, has a radius of 25 and extends from the angle 45 to the angle 315 (270 degrees long), and is round.

    import javafx.scene.shape.*;
    
    Arc arc = new Arc();
    arc.setCenterX(50.0f);
    arc.setCenterY(50.0f);
    arc.setRadiusX(25.0f);
    arc.setRadiusY(25.0f);
    arc.setStartAngle(45.0f);
    arc.setLength(270.0f);
    arc.setType(ArcType.ROUND);
    
    Since:
    JavaFX 2.0
    • Constructor Detail

      • Arc

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

        public Arc​(double centerX,
                   double centerY,
                   double radiusX,
                   double radiusY,
                   double startAngle,
                   double length)
        Creates a new instance of Arc.
        Parameters:
        centerX - the X coordinate of the center point of the arc
        centerY - the Y coordinate of the center point of the arc
        radiusX - the overall width (horizontal radius) of the full ellipse of which this arc is a partial section
        radiusY - the overall height (vertical radius) of the full ellipse of which this arc is a partial section
        startAngle - the starting angle of the arc in degrees
        length - the angular extent of the arc in degrees
    • Method Detail

      • setCenterX

        public final void setCenterX​(double value)
        Sets the value of the property centerX.
        Property description:
        Defines the X coordinate of the center point of the arc.
        Default value:
        0.0
      • getCenterX

        public final double getCenterX()
        Gets the value of the property centerX.
        Property description:
        Defines the X coordinate of the center point of the arc.
        Default value:
        0.0
      • setCenterY

        public final void setCenterY​(double value)
        Sets the value of the property centerY.
        Property description:
        Defines the Y coordinate of the center point of the arc.
        Default value:
        0.0
      • getCenterY

        public final double getCenterY()
        Gets the value of the property centerY.
        Property description:
        Defines the Y coordinate of the center point of the arc.
        Default value:
        0.0
      • setRadiusX

        public final void setRadiusX​(double value)
        Sets the value of the property radiusX.
        Property description:
        Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
      • getRadiusX

        public final double getRadiusX()
        Gets the value of the property radiusX.
        Property description:
        Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
      • radiusXProperty

        public final DoubleProperty radiusXProperty()
        Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
        See Also:
        getRadiusX(), setRadiusX(double)
      • setRadiusY

        public final void setRadiusY​(double value)
        Sets the value of the property radiusY.
        Property description:
        Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
      • getRadiusY

        public final double getRadiusY()
        Gets the value of the property radiusY.
        Property description:
        Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
      • radiusYProperty

        public final DoubleProperty radiusYProperty()
        Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
        Default value:
        0.0
        See Also:
        getRadiusY(), setRadiusY(double)
      • setStartAngle

        public final void setStartAngle​(double value)
        Sets the value of the property startAngle.
        Property description:
        Defines the starting angle of the arc in degrees.
        Default value:
        0.0
      • getStartAngle

        public final double getStartAngle()
        Gets the value of the property startAngle.
        Property description:
        Defines the starting angle of the arc in degrees.
        Default value:
        0.0
      • setLength

        public final void setLength​(double value)
        Sets the value of the property length.
        Property description:
        Defines the angular extent of the arc in degrees.
        Default value:
        0.0
      • getLength

        public final double getLength()
        Gets the value of the property length.
        Property description:
        Defines the angular extent of the arc in degrees.
        Default value:
        0.0
      • toString

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