|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectballworlds.ball.Ball
ballworlds.ball.Dud
public class Dud
A Dud is a Ball that merely appears on the screen. Each Dud appears in a random location in its World.
Constructor Summary | |
---|---|
Dud(BallEnvironment ballEnvironment)
Adds the Dud to its World at a random location with the default color and diameter for Dud's. |
Method Summary | |
---|---|
void |
act()
Does anything the Animate object wishes. |
void |
die()
Removes the Animate object from its World. |
double |
distanceFrom(Point2D point)
Returns the distance that the Relocatable object is from the given Point2D. |
protected BallEnvironment |
getBallEnvironment()
Returns the value of the field called 'ballEnvironment'. |
Color |
getColor()
Returns the Color of this Drawable. |
protected double |
getDiameter()
Returns the value of the field called 'diameter'. |
protected Point2D |
getLocation()
Returns the value of the field called 'location'. |
Shape |
getShape()
Returns the Shape (which contains position and size) of this Drawable. |
void |
moveTo(Point2D point)
Moves the Relocatable object to the given Point2D, by setting its position (part of its Shape) to the given Point2D. |
void |
pauseOrResume()
Toggles between the "paused" and "not-paused" state. |
protected void |
setColor(Color color)
Sets the field called 'color' to the given value. |
protected void |
setDiameter(double diameter)
Sets the field called 'diameter' to the given value. |
protected void |
setLocation(Point2D location)
Sets the field called 'location' to the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Dud(BallEnvironment ballEnvironment)
ballEnvironment
- the object that manages Balls in this WorldMethod Detail |
---|
public Color getColor()
Drawable
public Shape getShape()
Drawable
public double distanceFrom(Point2D point)
Relocatable
point
- the Point2D from which the distance is desired.
public void moveTo(Point2D point)
Relocatable
point
- the Point2D to which the Relocatable object should move.public void act()
Animate
public void die()
Animate
public void pauseOrResume()
Animate
protected final Point2D getLocation()
protected final void setLocation(Point2D location)
location
- The location to set.protected final void setColor(Color color)
color
- The color to set.protected final BallEnvironment getBallEnvironment()
protected final double getDiameter()
protected final void setDiameter(double diameter)
diameter
- The diameter to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |