Class Circle

java.lang.Object
  extended by Circle

public class Circle
extends Object

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

Version:
2006.03.30/2007.01.30/2009.09.09
Author:
Michael Kolling and David J. Barnes, mod.by Denis BUREAU

Constructor Summary
Circle()
          Create a new circle at default position with default color.
 
Method Summary
 void changeColor(String pNewColor)
          Change the color.
 void changeSize(int pNewDiameter)
          Change the size to the new size (in pixels).
 void doubleSize()
          Double the size (in pixels).
 void makeInvisible()
          Make this circle invisible.
 void makeVisible()
          Make this circle visible.
 void moveDown()
           
 void moveHorizontal(int pDistance)
          Move the circle horizontally by 'distance' pixels.
 void moveLeft()
           
 void moveRight()
          Move the circle a few pixels to the right.
 void moveUp()
          Move the circle a few pixels up.
 void moveVertical(int pDistance)
           
 void slowMoveHorizontal(int pDistance)
          Slowly move the shape horizontally by 'distance' pixels.
 void slowMoveVertical(int pDistance)
           
 
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

changeColor

public void changeColor(String pNewColor)
Change the color. Valid colors are "red", "yellow", "blue", "green", "magenta" and "black".

Parameters:
pNewColor - color we want for this circle

changeSize

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

Parameters:
pNewDiameter - diameter we want for this circle

doubleSize

public void doubleSize()
Double the size (in pixels).


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()

moveHorizontal

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

Parameters:
pDistance - nb of pixels to move towards right

moveLeft

public void moveLeft()

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 pDistance)

slowMoveHorizontal

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

Parameters:
pDistance - nb of pixels to move towards right

slowMoveVertical

public void slowMoveVertical(int pDistance)