Class Circle
java.lang.Object
|
+----Circle
- public class Circle
- extends Object
A simple circle class.
- Author:
- Samuel A. Rebelsky
Constructor Index
- o
Circle(int)
- Create a new circle with specified diameter and default color.
- o
Circle(int, Color)
- Create a new circle with specified diameter and color.
Method Index
- o
draw(int, int, Graphics)
- Draw this circle centered at a particular position in a
graphics thingy.
- o
getSize()
- Get the diameter of this circle.
- o
setColor(Color)
- Set the color of this circle.
- o
setSize(int)
- Set the diameter of this circle.
Constructors
o
Circle
public Circle(int diameter,
Color color)
- Create a new circle with specified diameter and color.
o
Circle
public Circle(int diameter)
- Create a new circle with specified diameter and default color.
Methods
o
draw
public void draw(int x,
int y,
Graphics g)
- Draw this circle centered at a particular position in a
graphics thingy. To make it look more interesting, I outline
the circle in some color.
o
getSize
public int getSize()
- Get the diameter of this circle.
o
setColor
public void setColor(Color newColor)
- Set the color of this circle.
o
setSize
public void setSize(int newDiameter)
- Set the diameter of this circle.