java.awt.geom

Class Arc2D.Double

public static class Arc2D.Double extends Arc2D

This class implements an arc in double precision.

Since: 1.2

Field Summary
doubleextent
The extent angle of this arc, in degrees.
doubleheight
The height of the box bounding the ellipse of this arc.
doublestart
The start angle of this arc, in degrees.
doublewidth
The width of the box bounding the ellipse of this arc.
doublex
The x coordinate of the box bounding the ellipse of this arc.
doubley
The y coordinate of the box bounding the ellipse of this arc.
Constructor Summary
Double()
Create a new, open arc at (0,0) with 0 extent.
Double(int type)
Create a new arc of the given type at (0,0) with 0 extent.
Double(double x, double y, double w, double h, double start, double extent, int type)
Create a new arc with the given dimensions.
Double(Rectangle2D r, double start, double extent, int type)
Create a new arc with the given dimensions.
Method Summary
doublegetAngleExtent()
Return the extent of the arc, in degrees.
doublegetAngleStart()
Return the start angle of the arc, in degrees.
doublegetHeight()
Return the height of the bounding box.
doublegetWidth()
Return the width of the bounding box.
doublegetX()
Return the x coordinate of the bounding box.
doublegetY()
Return the y coordinate of the bounding box.
booleanisEmpty()
Tests if the arc contains points.
protected Rectangle2DmakeBounds(double x, double y, double w, double h)
Creates a tight bounding box given dimensions that more precise than the bounding box of the ellipse.
voidsetAngleExtent(double extent)
Sets the extent angle of the arc.
voidsetAngleStart(double start)
Sets the start angle of the arc.
voidsetArc(double x, double y, double w, double h, double start, double extent, int type)
Sets the arc to the given dimensions.

Field Detail

extent

public double extent
The extent angle of this arc, in degrees.

height

public double height
The height of the box bounding the ellipse of this arc.

start

public double start
The start angle of this arc, in degrees.

width

public double width
The width of the box bounding the ellipse of this arc.

x

public double x
The x coordinate of the box bounding the ellipse of this arc.

y

public double y
The y coordinate of the box bounding the ellipse of this arc.

Constructor Detail

Double

public Double()
Create a new, open arc at (0,0) with 0 extent.

Double

public Double(int type)
Create a new arc of the given type at (0,0) with 0 extent.

Parameters: type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}

Throws: IllegalArgumentException if type is invalid

Double

public Double(double x, double y, double w, double h, double start, double extent, int type)
Create a new arc with the given dimensions.

Parameters: x the x coordinate y the y coordinate w the width h the height start the start angle, in degrees extent the extent, in degrees type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}

Throws: IllegalArgumentException if type is invalid

Double

public Double(Rectangle2D r, double start, double extent, int type)
Create a new arc with the given dimensions.

Parameters: r the bounding box start the start angle, in degrees extent the extent, in degrees type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}

Throws: IllegalArgumentException if type is invalid NullPointerException if r is null

Method Detail

getAngleExtent

public double getAngleExtent()
Return the extent of the arc, in degrees.

Returns: the value of extent

getAngleStart

public double getAngleStart()
Return the start angle of the arc, in degrees.

Returns: the value of start

getHeight

public double getHeight()
Return the height of the bounding box.

Returns: the value of height

getWidth

public double getWidth()
Return the width of the bounding box.

Returns: the value of width

getX

public double getX()
Return the x coordinate of the bounding box.

Returns: the value of x

getY

public double getY()
Return the y coordinate of the bounding box.

Returns: the value of y

isEmpty

public boolean isEmpty()
Tests if the arc contains points.

Returns: true if the arc has no interior

makeBounds

protected Rectangle2D makeBounds(double x, double y, double w, double h)
Creates a tight bounding box given dimensions that more precise than the bounding box of the ellipse.

Parameters: x the x coordinate y the y coordinate w the width h the height

setAngleExtent

public void setAngleExtent(double extent)
Sets the extent angle of the arc.

Parameters: extent the new extent angle

setAngleStart

public void setAngleStart(double start)
Sets the start angle of the arc.

Parameters: start the new start angle

setArc

public void setArc(double x, double y, double w, double h, double start, double extent, int type)
Sets the arc to the given dimensions.

Parameters: x the x coordinate y the y coordinate w the width h the height start the start angle, in degrees extent the extent, in degrees type the arc type: {@link #OPEN}, {@link #CHORD}, or {@link #PIE}

Throws: IllegalArgumentException if type is invalid