import java.awt.*; import java.awt.event.*; import objectdraw.*; // Name: // Description: public class BallController extends WindowController { // Upper left corner of the boundary private static final Location UPPERLEFT = new Location (10, 10); // Size of boundary private static final int BOUNDARY_WIDTH = 300; private static final int BOUNDARY_HEIGHT = BOUNDARY_WIDTH; // The ball to bounce private BouncyBall ball; // The size of the ball private static final int MEDIUM_SIZE = 30; // Initial ball speed in pixels per second private static final int MIN_SPEED = 40; private static final int MAX_SPEED = 600; // Initial color of the ball private static final Color INITIAL_COLOR = Color.black; // Set up GUI controls, boundary, and start up the ball. public void begin () { FramedRect boundary = new FramedRect (UPPERLEFT, BOUNDARY_HEIGHT, BOUNDARY_WIDTH, canvas); ball = new BouncyBall (MIN_SPEED, MIN_SPEED, INITIAL_COLOR, MEDIUM_SIZE, canvas, boundary); // initialize GUI components here } // end begin // Add event-handling methods here! } // end BallController class