java.awt.geom

Class Arc2D.Float

public static class Arc2D.Float extends Arc2D

This class implements an arc in float precision.

Since: 1.2

Field Summary
floatextent
The extent angle of this arc, in degrees.
floatheight
The height of the box bounding the ellipse of this arc.
floatstart
The start angle of this arc, in degrees.
floatwidth
The width of the box bounding the ellipse of this arc.
floatx
The x coordinate of the box bounding the ellipse of this arc.
floaty
The y coordinate of the box bounding the ellipse of this arc.
Constructor Summary
Float()
Create a new, open arc at (0,0) with 0 extent.
Float(int type)
Create a new arc of the given type at (0,0) with 0 extent.
Float(float x, float y, float w, float h, float start, float extent, int type)
Create a new arc with the given dimensions.
Float(Rectangle2D r, float start, float 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 float extent
The extent angle of this arc, in degrees.

height

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

start

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

width

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

x

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

y

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

Constructor Detail

Float

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

Float

public Float(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

Float

public Float(float x, float y, float w, float h, float start, float 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

Float

public Float(Rectangle2D r, float start, float 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