|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.geom.Circle
public class Circle
A circle described by a central point and radial length.
This circle class fits in with java's 2D
package.
Version Info:
$Revision: 797 $ |
$Date: 2007-08-08 16:48:50 -0600 (Wed, 08 Aug 2007) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
Circle(double radius)
Creates a new circle, centered at the origin, with the given radius. |
|
Circle(Point2D center,
double radius)
Creates a new circle with the given center and radius. |
Method Summary | |
---|---|
Circle |
clone()
Creates a copy of this circle. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double x,
double y,
double w,
double h)
|
boolean |
contains(Point2D p)
|
boolean |
contains(Rectangle2D r)
|
Rectangle |
getBounds()
|
Rectangle2D |
getBounds2D()
|
Point2D |
getCenter()
Returns a copy of the center of this circle. |
double |
getDiameter()
Returns the diameter of this circle. |
PathIterator |
getPathIterator(AffineTransform at)
|
PathIterator |
getPathIterator(AffineTransform at,
double flatness)
|
double |
getRadius()
Returns the radius of this circle. |
boolean |
intersects(double x,
double y,
double w,
double h)
|
boolean |
intersects(Rectangle2D r)
|
void |
setCenter(Point2D newCenter)
Sets the center of this circle to be coincident with newCenter . |
void |
setRadius(double newRadius)
Sets the radius of this circle. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Circle(double radius)
radius
- the radius of this circle. The units are arbitrary,
but are often taken to be pixels.public Circle(Point2D center, double radius)
center
- the center of this circle.radius
- the radius of this circle. The units are arbitrary,
but are often taken to be pixels. If this value
is infinite, negative, or not a number, the radius
will be set to one.Method Detail |
---|
public void setRadius(double newRadius)
newRadius
is negative, infinite, or not a number, an
IllegalArgumentException is thrown.
newRadius
- the new radius of this circle.public double getRadius()
public double getDiameter()
public void setCenter(Point2D newCenter)
newCenter
.
Note that this circle will not hold a reference to
newCenter
, so changes made to it after calling this method
will not be reflected herein.
If newCenter
is null, the center of this circle will
not be altered.
newCenter
- the new center of this circle.public Point2D getCenter()
public boolean contains(double x, double y)
contains
in interface Shape
public boolean contains(double x, double y, double w, double h)
contains
in interface Shape
public boolean contains(Point2D p)
contains
in interface Shape
public boolean contains(Rectangle2D r)
contains
in interface Shape
public Rectangle getBounds()
getBounds
in interface Shape
public Rectangle2D getBounds2D()
getBounds2D
in interface Shape
public PathIterator getPathIterator(AffineTransform at)
getPathIterator
in interface Shape
public PathIterator getPathIterator(AffineTransform at, double flatness)
getPathIterator
in interface Shape
public boolean intersects(double x, double y, double w, double h)
intersects
in interface Shape
public boolean intersects(Rectangle2D r)
intersects
in interface Shape
public Circle clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |