import objectdraw.*;
import java.awt.*;

/*
 * Example DrawBBalls: draw basketballs on mouse dragging
 *
 * Jim Teresco, Siena College, CSIS 120, Fall 2011
 *
 * $Id: DrawBBalls.java 1540 2011-02-15 17:50:40Z terescoj $
 */

public class DrawBBalls extends WindowController {

    public static final double BBALL_SIZE = 50;

    // draw a nice basketball centered at the mouse point on each drag
    public void onMouseDrag(Location point) {

        new NiceBBall(point.getX() - BBALL_SIZE/2,
            point.getY() - BBALL_SIZE/2,
            BBALL_SIZE, canvas);
    }

    // clean up when we re-enter the window  
    public void onMouseEnter(Location point) {

        canvas.clear();
    }
}
