|
Ball World Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ballworld.Shrinker
A ball that falls and shrinks at the same time.
Constructor Summary | |
Shrinker()
Create a default shrinker. |
|
Shrinker(double x,
double y)
Create a shrinker at a given point and give it random velocities |
Method Summary | |
void |
act()
|
double |
getRadius()
Returns the current radius of the Ball |
double |
getX()
Returns the current horizontal location of the Ball |
double |
getY()
Returns the current vertical location of the Ball |
void |
setWorld(World theWorld)
This method will be called by our setup code shortly after your Ball is created. |
void |
userClicked(double x,
double y)
Process a click from the mouse. |
void |
userTyped(char key)
This method is called if the user selects this particualr ball and then types a key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Shrinker(double x, double y)
x
- The x coordinate to start at.y
- The y coordinte to start atpublic Shrinker()
Method Detail |
public double getX()
Ball
getX
in interface Ball
public double getY()
Ball
getY
in interface Ball
public double getRadius()
Ball
getRadius
in interface Ball
public void setWorld(World theWorld)
Ball
setWorld
in interface Ball
theWorld
- A world object that contains this ballpublic void userClicked(double x, double y)
Ball
userClicked
in interface Ball
x
- The x coordinate of the user's clicky
- The y coordinate of the user's clickpublic void userTyped(char key)
Ball
userTyped
in interface Ball
key
- The character from the key that the user typed.public void act()
act
in interface Animate
|
Ball World Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |