Class MyCircle

java.lang.Object
  extended bym865.shapepack.Shape
      extended bym865.shapepack.Ellipse
          extended byMyCircle

public class MyCircle
extends Ellipse

A Circle subclass of Ellipse.

Version:
1.0 09/04/05
Author:
Daniel D. Warner

Field Summary
 
Fields inherited from class m865.shapepack.Shape
color, defaultColor, defaultHeight, defaultWidth, height, width, x, y
 
Constructor Summary
MyCircle(int x, int y)
          Constructor for a circle at the specified location with the default color and the default height as the diameter.
MyCircle(int x, int y, int d, java.awt.Color c)
          The generic constructor for a circle.
 
Method Summary
 void setHeight(int d)
          Set the height of the circle.
 void setWidth(int d)
          Set the width of the circle.
 java.lang.String toString()
          Generates a string describing the parameters of the shape.
 
Methods inherited from class m865.shapepack.Ellipse
area, draw, perimeter
 
Methods inherited from class m865.shapepack.Shape
getColor, getHeight, getWidth, getX, getY, moveTo, setColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MyCircle

public MyCircle(int x,
                int y,
                int d,
                java.awt.Color c)
The generic constructor for a circle.

Parameters:
x - horizontal coordinate of the upper left corner of the bounding box.
y - vertical coordinate of the upper left corner of the bounding box.
d - diameter of the circle (width and height of the bounding box).
c - fill color for the circle.

MyCircle

public MyCircle(int x,
                int y)
Constructor for a circle at the specified location with the default color and the default height as the diameter.

Parameters:
x - horizontal coordinate of the upper left corner of the bounding box.
y - vertical coordinate of the upper left corner of the bounding box.
Method Detail

setWidth

public void setWidth(int d)
Set the width of the circle.

Overrides:
setWidth in class Shape
Parameters:
d - the new diameter of the circle (and width and height of the bounding box).

setHeight

public void setHeight(int d)
Set the height of the circle.

Overrides:
setHeight in class Shape
Parameters:
d - the new diameter of the circle (and width and height of the bounding box).

toString

public java.lang.String toString()
Description copied from class: Shape
Generates a string describing the parameters of the shape.

Overrides:
toString in class Ellipse