CSci 126 Java Programming Projects


Third assignment, due Nov. 15, 1996

Expand your figure editor to allow the figures to be dragged about or deleted.

You'll need to keep track of what figures have been created so far, and you can do that in an array. You'll also need to be able to determine when a keyclick occurs inside a figure so you know which figure has been selected.

* Some suggestions

You can save the figures in an array.
  int nFigures;                     // the current number of figures
  Figure fig[];                     // the array of figures
Here, figure is an abstract class, see Figure.java. Particular kinds of figures subclass it, for instance, RectFigure is described in RectFigure.java.

* Sources

(Not yet available.)

Editor.java, extends Applet.

Figure.java, abstract class.

LineFigure.java, extends Figure.

OvalFigure.java, extends Figure.

RectFigure.java, extends Figure.

Back to course page