Class Circle

java.lang.Object
  extended by Circle

public class Circle
extends java.lang.Object

A circle that can be manipulated and that draws itself on a canvas.

Version:
1.1 (August 2005) using an enum for Colour
Author:
Michael Kolling and David J. Barnes, Pete Lee

Constructor Summary
Circle()
          Create a new circle at default position with default color.
 
Method Summary
 void changeColour(Colour newColour)
          Change the colour.
 void changeSize(int newDiameter)
          Change the size to the new size (in pixels).
 void makeInvisible()
          Make this circle invisible.
 void makeVisible()
          Make this circle visible.
 void moveDown()
          Move the circle a few pixels down.
 void moveHorizontal(int distance)
          Move the circle horizontally by 'distance' pixels.
 void moveLeft()
          Move the circle a few pixels to the left.
 void moveRight()
          Move the circle a few pixels to the right.
 void moveUp()
          Move the circle a few pixels up.
 void moveVertical(int distance)
          Move the circle vertically by 'distance' pixels.
 void slowMoveHorizontal(int distance)
          Slowly move the circle horizontally by 'distance' pixels.
 void slowMoveVertical(int distance)
          Slowly move the circle vertically by 'distance' pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Circle

public Circle()
Create a new circle at default position with default color.

Method Detail

changeColour

public void changeColour(Colour newColour)
Change the colour. Valid colours are Colour.RED, Colour.YELLOW, Colour.BLUE, Colour.GREEN, Colour.MAGENTA and Colour.BLACK.


changeSize

public void changeSize(int newDiameter)
Change the size to the new size (in pixels). Size must be >= 0.


makeInvisible

public void makeInvisible()
Make this circle invisible. If it was already invisible, do nothing.


makeVisible

public void makeVisible()
Make this circle visible. If it was already visible, do nothing.


moveDown

public void moveDown()
Move the circle a few pixels down.


moveHorizontal

public void moveHorizontal(int distance)
Move the circle horizontally by 'distance' pixels.


moveLeft

public void moveLeft()
Move the circle a few pixels to the left.


moveRight

public void moveRight()
Move the circle a few pixels to the right.


moveUp

public void moveUp()
Move the circle a few pixels up.


moveVertical

public void moveVertical(int distance)
Move the circle vertically by 'distance' pixels.


slowMoveHorizontal

public void slowMoveHorizontal(int distance)
Slowly move the circle horizontally by 'distance' pixels.


slowMoveVertical

public void slowMoveVertical(int distance)
Slowly move the circle vertically by 'distance' pixels.