cmsc420.geom
Class Circle2D

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Ellipse2D
          extended by cmsc420.geom.Circle2D
All Implemented Interfaces:
Geometry2D, java.awt.Shape, java.lang.Cloneable
Direct Known Subclasses:
Circle2D.Double, Circle2D.Float

public abstract class Circle2D
extends java.awt.geom.Ellipse2D
implements Geometry2D

The Circle2D class describes a circle that is defined by a bounding rectangle. It is implemented as a java.awt.geom.Ellipse2D that has been restricted such that the width must also equal the height. It also implements the Geometry2D interface.

This class is only the abstract superclass for all objects which store a 2D ellipse. The actual storage representation of the coordinates is left to the subclass.

Version:
1.0, 12 Feb 2007
Author:
Ben Zoller

Nested Class Summary
static class Circle2D.Double
          The Double class defines an ellipse specified in double precision.
static class Circle2D.Float
          The Float class defines an ellipse specified in float precision.
 
Field Summary
 
Fields inherited from interface cmsc420.geom.Geometry2D
CIRCLE, POINT, RECTANGLE, SEGMENT
 
Constructor Summary
Circle2D()
           
 
Method Summary
 java.awt.geom.Point2D getCenter()
          Gets the center point of this circle.
abstract  double getRadius()
          Gets the radius of this circle.
 int getType()
          Gets the type of this Geometry2D object.
abstract  void setCenter(java.awt.geom.Point2D point)
          Sets the center point of this circle.
abstract  void setRadius(double radius)
          Sets the radius of this circle.
 
Methods inherited from class java.awt.geom.Ellipse2D
contains, contains, equals, getPathIterator, hashCode, intersects
 
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
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
getBounds2D
 

Constructor Detail

Circle2D

public Circle2D()
Method Detail

getType

public int getType()
Gets the type of this Geometry2D object.

Specified by:
getType in interface Geometry2D
Returns:
circle type

getCenter

public java.awt.geom.Point2D getCenter()
Gets the center point of this circle.

Returns:
center point of this circle

getRadius

public abstract double getRadius()
Gets the radius of this circle.

Returns:
radius of this circle

setCenter

public abstract void setCenter(java.awt.geom.Point2D point)
Sets the center point of this circle.

Parameters:
point - center point of this circle

setRadius

public abstract void setRadius(double radius)
Sets the radius of this circle.

Parameters:
radius - radius of this circle