Ball World Problem Set Javadocs

ballworld
Class Exploder

java.lang.Object
  extended byballworld.Exploder
All Implemented Interfaces:
Animate, Ball

public class Exploder
extends java.lang.Object
implements Animate, Ball

A ball that Explodes.

Author:
(original author unknown), Patrick G. Heck

Constructor Summary
Exploder()
          Create a new exploder with default position.
Exploder(double startx, double starty, int generation)
          Create an exploder at given coordinates and a predfined generation.
Exploder(World myWorld)
          Create a new exploder that is aware of it's world from the start.
 
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

Exploder

public Exploder()
Create a new exploder with default position.


Exploder

public Exploder(World myWorld)
Create a new exploder that is aware of it's world from the start.

Parameters:
myWorld - The world that the ball is being created in

Exploder

public Exploder(double startx,
                double starty,
                int generation)
Create an exploder at given coordinates and a predfined generation.

Parameters:
generation - Our generation
startx - Our starting x coordinate
starty - Our starting y coordinate
Method Detail

getX

public double getX()
Description copied from interface: Ball
Returns the current horizontal location of the Ball

Specified by:
getX in interface Ball
Returns:
The horizontal location

getY

public double getY()
Description copied from interface: Ball
Returns the current vertical location of the Ball

Specified by:
getY in interface Ball
Returns:
The vertical location

getRadius

public double getRadius()
Description copied from interface: Ball
Returns the current radius of the Ball

Specified by:
getRadius in interface Ball
Returns:
The radius

setWorld

public void setWorld(World theWorld)
Description copied from interface: Ball
This method will be called by our setup code shortly after your Ball is created. If you would like to use the World object to get information about the world, then you should store the parameter of this method somewhere safe.

Specified by:
setWorld in interface Ball
Parameters:
theWorld - A world object that contains this ball

userClicked

public void userClicked(double x,
                        double y)
Description copied from interface: Ball
Process a click from the mouse. This method is called if the user selects this particular ball and then clicks or drags the mouse somewhere. The atX and atY parameters are the location that the user released the mouse button.

Specified by:
userClicked in interface Ball
Parameters:
x - The x coordinate of the user's click
y - The y coordinate of the user's click

userTyped

public void userTyped(char key)
Description copied from interface: Ball
This method is called if the user selects this particualr ball and then types a key. The key that the user typed is passed as the parameter. Note that not all keys on the keyboard will cause this method to get called -- only those keys that have a printable form. (For instance, the 'J' or space key will trigger this method, but the arrow and function keys may not.)

Specified by:
userTyped in interface Ball
Parameters:
key - The character from the key that the user typed.

act

public void act()
Specified by:
act in interface Animate

Ball World Problem Set Javadocs