ballworlds.framework
Interface CollectionOfBalls

All Known Implementing Classes:
World

public interface CollectionOfBalls

A CollectionOfBalls provides for the management of a collection of Balls.

Author:
David Mutchler, Salman Azhar and others, January 2005. Modified September, 2008.

Method Summary
 void drawBalls(Graphics2D graphics, Ball selectedBall)
          Draws the Balls in this CollectionOfBall's World.
 Ball nearestBall(Point2D p)
          Returns the Ball in this CollectionOfBall's World that is nearest the given point.
 

Method Detail

nearestBall

Ball nearestBall(Point2D p)
Returns the Ball in this CollectionOfBall's World that is nearest the given point. Returns null if there are no Balls in this CollectionOfBall's World.

Parameters:
p - the point for which to find the nearest Ball
Returns:
the Ball in this CollectionOfBall's World that is nearest the given point

drawBalls

void drawBalls(Graphics2D graphics,
               Ball selectedBall)
Draws the Balls in this CollectionOfBall's World.

Parameters:
graphics - the object onto which to draw
selectedBall - the ball which has been selected (null if none)