Demos.Polymorphism
Class BouncingBall
java.lang.Object
NGP.Graphics.Shape
NGP.Graphics.RectangularShape
NGP.Graphics.FilledRectangularShape
NGP.Graphics.FilledEllipse
Demos.Polymorphism.BouncingBall
- All Implemented Interfaces:
- MouseListener, MouseMotionListener, EventListener, Colorable, Graphic, Locatable, Reactor, Rotatable, Sizeable
public class BouncingBall
- extends FilledEllipse
A ball that bounces around on an applet.
- Author:
- Adrienne
Decker, based on the Demos.Bounce.Ball written by Phil Ventura
Constructor Summary |
BouncingBall()
Creates a new BouncingBall instance. |
Method Summary |
void |
startBouncing()
Method to be called when the user wants the ball to start bouncing. |
void |
stopBouncing()
Method to be called when user wants the ball to stop bouncing. |
Methods inherited from class NGP.Graphics.Shape |
contains, drag, getBounds, getCenterLocation, getColor, getDrawingPanel, getRotation, hide, intersects, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paint, react, setColor, setDrawingPanel, setRotation, show |
BouncingBall
public BouncingBall()
- Creates a new
BouncingBall
instance.
stopBouncing
public void stopBouncing()
- Method to be called when user wants the ball to stop bouncing.
startBouncing
public void startBouncing()
- Method to be called when the user wants the ball to start bouncing.