java.awt.geom

Class Arc2D.Float

Enclosing Class:
Arc2D
Implemented Interfaces:
Cloneable, Shape

public static class Arc2D.Float
extends Arc2D

This class implements an arc in float precision.
Since:
1.2

Nested Class Summary

Nested classes/interfaces inherited from class java.awt.geom.Arc2D

Arc2D.Double, Arc2D.Float

Field Summary

float
extent
The extent angle of this arc, in degrees.
float
height
The height of the box bounding the ellipse of this arc.
float
start
The start angle of this arc, in degrees.
float
width
The width of the box bounding the ellipse of this arc.
float
x
The x coordinate of the box bounding the ellipse of this arc.
float
y
The y coordinate of the box bounding the ellipse of this arc.

Fields inherited from class java.awt.geom.Arc2D

CHORD, OPEN, PIE

Constructor Summary

Float()
Create a new, open arc 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(int type)
Create a new arc of the given type at (0,0) with 0 extent.
Float(Rectangle2D r, float start, float extent, int type)
Create a new arc with the given dimensions.

Method Summary

double
getAngleExtent()
Return the extent of the arc, in degrees.
double
getAngleStart()
Return the start angle of the arc, in degrees.
double
getHeight()
Return the height of the bounding box.
double
getWidth()
Return the width of the bounding box.
double
getX()
Return the x coordinate of the bounding box.
double
getY()
Return the y coordinate of the bounding box.
boolean
isEmpty()
Tests if the arc contains points.
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.
void
setAngleExtent(double extent)
Sets the extent angle of the arc.
void
setAngleStart(double start)
Sets the start angle of the arc.
void
setArc(double x, double y, double w, double h, double start, double extent, int type)
Sets the arc to the given dimensions.

Methods inherited from class java.awt.geom.Arc2D

contains, contains, contains, containsAngle, getAngleExtent, getAngleStart, getArcType, getBounds2D, getEndPoint, getPathIterator, getStartPoint, intersects, makeBounds, setAngleExtent, setAngleStart, setAngleStart, setAngles, setAngles, setArc, setArc, setArc, setArc, setArcByCenter, setArcByTangent, setArcType, setFrame

Methods inherited from class java.awt.geom.RectangularShape

clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getHeight, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, getWidth, getX, getY, intersects, isEmpty, setFrame, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

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 Details

Float

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

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: Arc2D.OPEN, Arc2D.CHORD, or Arc2D.PIE
Throws:
IllegalArgumentException - if type is invalid

Float

public Float(int type)
Create a new arc of the given type at (0,0) with 0 extent.
Parameters:
type - the arc type: Arc2D.OPEN, Arc2D.CHORD, or Arc2D.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: Arc2D.OPEN, Arc2D.CHORD, or Arc2D.PIE
Throws:
IllegalArgumentException - if type is invalid
NullPointerException - if r is null

Method Details

getAngleExtent

public double getAngleExtent()
Return the extent of the arc, in degrees.
Overrides:
getAngleExtent in interface Arc2D
Returns:
the value of extent

getAngleStart

public double getAngleStart()
Return the start angle of the arc, in degrees.
Overrides:
getAngleStart in interface Arc2D
Returns:
the value of start

getHeight

public double getHeight()
Return the height of the bounding box.
Overrides:
getHeight in interface RectangularShape
Returns:
the value of height

getWidth

public double getWidth()
Return the width of the bounding box.
Overrides:
getWidth in interface RectangularShape
Returns:
the value of width

getX

public double getX()
Return the x coordinate of the bounding box.
Overrides:
getX in interface RectangularShape
Returns:
the value of x

getY

public double getY()
Return the y coordinate of the bounding box.
Overrides:
getY in interface RectangularShape
Returns:
the value of y

isEmpty

public boolean isEmpty()
Tests if the arc contains points.
Overrides:
isEmpty in interface RectangularShape
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.
Overrides:
makeBounds in interface Arc2D
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.
Overrides:
setAngleExtent in interface Arc2D
Parameters:
extent - the new extent angle

setAngleStart

public void setAngleStart(double start)
Sets the start angle of the arc.
Overrides:
setAngleStart in interface Arc2D
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.
Overrides:
setArc in interface Arc2D
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: Arc2D.OPEN, Arc2D.CHORD, or Arc2D.PIE
Throws:
IllegalArgumentException - if type is invalid

Arc2D.java -- represents an arc in 2-D space Copyright (C) 2002, 2003, 2004 Free Software Foundation This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.