Class Arc

All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasBlendModeProperty, HasClipProperty, HasEffectProperty, HasFillProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasParentProperty, HasSmoothProperty, HasStrokeDashOffsetProperty, HasStrokeLineCapProperty, HasStrokeLineJoinProperty, HasStrokeMiterLimitProperty, HasStrokeProperty, HasStrokeTypeProperty, HasStrokeWidthProperty, HasVisibleProperty, Styleable, EventTarget, INode

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
  • Property Details

  • Constructor Details

    • 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 Details

    • setCenterX

      public final void setCenterX(double value)
      Sets the value of the centerX property.
      Property description:
      Defines the X coordinate of the center point of the arc.
      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 X coordinate of the center point of the arc.
      Default value:
      0.0
      Returns:
      the value of the centerX property
      See Also:
    • centerXProperty

      public final DoubleProperty centerXProperty()
      Defines the X coordinate of the center point of the arc.
      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 Y coordinate of the center point of the arc.
      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 Y coordinate of the center point of the arc.
      Default value:
      0.0
      Returns:
      the value of the centerY property
      See Also:
    • centerYProperty

      public final DoubleProperty centerYProperty()
      Defines the Y coordinate of the center point of the arc.
      Default value:
      0.0
      Returns:
      the centerY property
      See Also:
    • setRadiusX

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

      public final double getRadiusX()
      Gets the value of the radiusX property.
      Property description:
      Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
      Default value:
      0.0
      Returns:
      the value of the radiusX property
      See Also:
    • 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
      Returns:
      the radiusX property
      See Also:
    • setRadiusY

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

      public final double getRadiusY()
      Gets the value of the radiusY property.
      Property description:
      Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
      Default value:
      0.0
      Returns:
      the value of the radiusY property
      See Also:
    • 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
      Returns:
      the radiusY property
      See Also:
    • setStartAngle

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

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

      public final DoubleProperty startAngleProperty()
      Defines the starting angle of the arc in degrees.
      Default value:
      0.0
      Returns:
      the startAngle property
      See Also:
    • setLength

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

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

      public final DoubleProperty lengthProperty()
      Defines the angular extent of the arc in degrees.
      Default value:
      0.0
      Returns:
      the length property
      See Also:
    • setType

      public final void setType(ArcType value)
      Sets the value of the type property.
      Property description:
      Defines the closure type for the arc: ArcType.OPEN, ArcType.CHORD,or ArcType.ROUND.
      Default value:
      OPEN
      Parameters:
      value - the value for the type property
      See Also:
    • getType

      public final ArcType getType()
      Gets the value of the type property.
      Property description:
      Defines the closure type for the arc: ArcType.OPEN, ArcType.CHORD,or ArcType.ROUND.
      Default value:
      OPEN
      Returns:
      the value of the type property
      See Also:
    • typeProperty

      public final ObjectProperty<ArcType> typeProperty()
      Defines the closure type for the arc: ArcType.OPEN, ArcType.CHORD,or ArcType.ROUND.
      Default value:
      OPEN
      Returns:
      the type property
      See Also:
    • toString

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

      public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx)
      Description copied from class: Node
      Computes the geometric bounds for this Node. This method is abstract and must be implemented by each Node subclass.
      Specified by:
      impl_computeGeomBounds in class Node