Ball World Problem Set Javadocs

ballworld
Class Faller

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

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

A Ball that falls and bounces.

Version:
$Id: Faller.java,v 1.4 2004/02/09 21:06:45 gus Exp $
Author:
(original author unknown), Patrick G. Heck gus.heck@olin.edu

Constructor Summary
Faller(World w)
          Create a faller that starts at the top, center of the screen
 
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 atX, double atY)
          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

Faller

public Faller(World w)
Create a faller that starts at the top, center of the screen

Parameters:
w - The world we are being creted in
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 atX,
                        double atY)
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:
atX - The x coordinate of the user's click
atY - 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