|
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.Throbber
A ball that sits in place and changes size. This ball can also be moved to new locations by selecting it and dragging the mouse to the desired new location.
Constructor Summary | |
Throbber()
Create a default throbber ball. |
|
Throbber(double x,
double y)
Create a throbber at the desired location. |
|
Throbber(World w)
A throbber that starts in the center of the upper right quadrant. |
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 Throbber()
public Throbber(double x, double y)
x
- The starting x positiony
- The starting y positionpublic Throbber(World w)
w
- The world in which we are startingMethod 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 |