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

/*
 * Example RubberBand
 *
 * A simple program to draw a rubber band line.
 * This version creates a single line segment and
 * the changes the end point each time the mouse moves.
 *
 * Jim Teresco, Siena College, CSIS 120, Fall 2011
 * Original from Williams College, CSCI 134
 *
 * $Id: RubberBand.java 1501 2011-01-24 20:48:50Z terescoj $
 */

public class RubberBand extends WindowController {

    private Line line;          // the line being drawn
    
    public void onMousePress(Location pressedPoint) {
        line = new Line(pressedPoint, pressedPoint, canvas);
    }

    public void onMouseDrag(Location point) {
        line.setEnd(point);
    }
}
