public static class

Arc2D.Double

extends Arc2D
implements Serializable
java.lang.Object
   ↳ java.awt.geom.RectangularShape
     ↳ java.awt.geom.Arc2D
       ↳ java.awt.geom.Arc2D.Double

Class Overview

This class defines an arc specified in double precision.

Summary

[Expand]
Inherited Constants
From class java.awt.geom.Arc2D
Fields
public double extent The angular extent of the arc in degrees.
public double height The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents).
public double start The starting angle of the arc in degrees.
public double width The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents).
public double x The X coordinate of the upper-left corner of the framing rectangle of the arc.
public double y The Y coordinate of the upper-left corner of the framing rectangle of the arc.
Public Constructors
Arc2D.Double()
Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0).
Arc2D.Double(int type)
Constructs a new arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0), and the specified closure type.
Arc2D.Double(double x, double y, double w, double h, double start, double extent, int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Arc2D.Double(Rectangle2D ellipseBounds, double start, double extent, int type)
Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
Public Methods
double getAngleExtent()
Returns the angular extent of the arc.
double getAngleStart()
Returns the starting angle of the arc.
double getHeight()
Returns the height of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.
double getWidth()
Returns the width of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.
double getX()
Returns the X coordinate of the upper-left corner of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.
double getY()
Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.
boolean isEmpty()
Determines whether the RectangularShape is empty.
void setAngleExtent(double angExt)
Sets the angular extent of this arc to the specified double value.
void setAngleStart(double angSt)
Sets the starting angle of this arc to the specified double value.
void setArc(double x, double y, double w, double h, double angSt, double angExt, int closure)
Sets the location, size, angular extents, and closure type of this arc to the specified double values.
Protected Methods
Rectangle2D makeBounds(double x, double y, double w, double h)
Constructs a Rectangle2D of the appropriate precision to hold the parameters calculated to be the framing rectangle of this arc.
[Expand]
Inherited Methods
From class java.awt.geom.Arc2D
From class java.awt.geom.RectangularShape
From class java.lang.Object
From interface java.awt.Shape

Fields

public double extent

The angular extent of the arc in degrees.

public double height

The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents).

public double start

The starting angle of the arc in degrees.

public double width

The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents).

public double x

The X coordinate of the upper-left corner of the framing rectangle of the arc.

public double y

The Y coordinate of the upper-left corner of the framing rectangle of the arc.

Public Constructors

public Arc2D.Double ()

Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0).

public Arc2D.Double (int type)

Constructs a new arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0), and the specified closure type.

Parameters
type The closure type for the arc: OPEN, CHORD, or PIE.

public Arc2D.Double (double x, double y, double w, double h, double start, double extent, int type)

Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.

Parameters
x The X coordinate of the upper-left corner of the arc's framing rectangle.
y The Y coordinate of the upper-left corner of the arc's framing rectangle.
w The overall width of the full ellipse of which this arc is a partial section.
h The overall height of the full ellipse of which this arc is a partial section.
start The starting angle of the arc in degrees.
extent The angular extent of the arc in degrees.
type The closure type for the arc: OPEN, CHORD, or PIE.

public Arc2D.Double (Rectangle2D ellipseBounds, double start, double extent, int type)

Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.

Parameters
ellipseBounds The framing rectangle that defines the outer boundary of the full ellipse of which this arc is a partial section.
start The starting angle of the arc in degrees.
extent The angular extent of the arc in degrees.
type The closure type for the arc: OPEN, CHORD, or PIE.

Public Methods

public double getAngleExtent ()

Returns the angular extent of the arc.

Returns
  • A double value that represents the angular extent of the arc in degrees.

public double getAngleStart ()

Returns the starting angle of the arc.

Returns
  • A double value that represents the starting angle of the arc in degrees.

public double getHeight ()

Returns the height of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.

Returns
  • the height of the framing rectangle.

public double getWidth ()

Returns the width of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.

Returns
  • the width of the framing rectangle.

public double getX ()

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.

Returns
  • the X coordinate of the upper-left corner of the framing rectangle.

public double getY ()

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision. Note that the arc partially inscribes the framing rectangle of this RectangularShape.

Returns
  • the Y coordinate of the upper-left corner of the framing rectangle.

public boolean isEmpty ()

Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.

Returns
  • true if the RectangularShape is empty; false otherwise.

public void setAngleExtent (double angExt)

Sets the angular extent of this arc to the specified double value.

Parameters
angExt The angular extent of the arc in degrees.

public void setAngleStart (double angSt)

Sets the starting angle of this arc to the specified double value.

Parameters
angSt The starting angle of the arc in degrees.

public void setArc (double x, double y, double w, double h, double angSt, double angExt, int closure)

Sets the location, size, angular extents, and closure type of this arc to the specified double values.

Parameters
x The X coordinate of the upper-left corner of the arc.
y The Y coordinate of the upper-left corner of the arc.
w The overall width of the full ellipse of which this arc is a partial section.
h The overall height of the full ellipse of which this arc is a partial section.
angSt The starting angle of the arc in degrees.
angExt The angular extent of the arc in degrees.
closure The closure type for the arc: OPEN, CHORD, or PIE.

Protected Methods

protected Rectangle2D makeBounds (double x, double y, double w, double h)

Constructs a Rectangle2D of the appropriate precision to hold the parameters calculated to be the framing rectangle of this arc.

Parameters
x The X coordinate of the upper-left corner of the framing rectangle.
y The Y coordinate of the upper-left corner of the framing rectangle.
w The width of the framing rectangle.
h The height of the framing rectangle.
Returns
  • a Rectangle2D that is the framing rectangle of this arc.