java.lang.ObjectSquare
public class Square
A square that can be manipulated and that draws itself on a canvas.
| Constructor Summary | |
|---|---|
Square()
Create a new square at default position with default color. |
|
| Method Summary | |
|---|---|
void |
changeColor(String pNewColor)
Change the color. |
void |
changeSize(int pNewSize)
Change the size to the new size (in pixels). |
void |
makeInvisible()
Make this square invisible. |
void |
makeVisible()
Make this square visible. |
void |
moveDown()
Move the square a few pixels down. |
void |
moveHorizontal(int pDistance)
Move the square horizontally by 'pDistance' pixels. |
void |
moveLeft()
Move the square a few pixels to the left. |
void |
moveRight()
Move the square a few pixels to the right. |
void |
moveUp()
Move the square a few pixels up. |
void |
moveVertical(int pDistance)
Move the square vertically by 'pDistance' pixels. |
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 |
|---|
public Square()
| Method Detail |
|---|
public void changeColor(String pNewColor)
public void changeSize(int pNewSize)
public void makeInvisible()
public void makeVisible()
public void moveDown()
public void moveHorizontal(int pDistance)
public void moveLeft()
public void moveRight()
public void moveUp()
public void moveVertical(int pDistance)
public void slowMoveHorizontal(int pDistance)
pDistance - nb of pixels to move towards rightpublic void slowMoveVertical(int pDistance)