import objectdraw.*;

/*
 * This program is a "Spirograph".  When the mouse is pressed then dragged,
 * a series of lines are drawn from the press point to the current location.
 *
 * Jim Teresco, Siena College, CSCI 120, Fall 2011
 * Based on similar example from Williams College CS 134.
 *
 * $Id: Spirograph.java 1495 2011-01-20 03:51:59Z terescoj $
 */
public class Spirograph extends WindowController {

  // First coordinate of a line segment
  private Location linesStart;

  /*
   * When the mouse is pressed, save the press point to be used as
   * the first endpoint of the lines drawn during dragging
   */
  public void onMousePress(Location point) {
    linesStart = point;
  } 

  /*
   * As the user is dragging, draw a line from
   * initial point where mouse pressed to current point.
   */
  public void onMouseDrag(Location point) {
    new Line(linesStart, point, canvas);
  }
}
