Reading: Chapter 8.
Due: At 8:00am, February 9, 1999, submit is turned off automatically. Work turned in after that time will not be accepted for grading.
The SimpleDraw example from Chapter 6 is the beginnings of a "painting" style program. For this assignment you will explore some of the concepts needed for a "drawing" style program. For this assignment you will not actually do any drawing, instead you will implement the underlying structure needed to keep track of all of the objects in a particular drawing.
This will be a standard, command line program. The user will be allowed to add objects to the drawing by specifying the object type and any relevant parameters. Your program should allow the user to place at least four different types of objects, text, rectangles, lines, and ovals. Once placed, an object/shape can be modified according to its type. For example, you might allow moving the location of the object, or changing its parameters such as height or width. The accessor methods used to modify an object will be different for different types of objects. For example, text doesn't have a width, but it has the text. Likewise a rectangle doesn't have any text.
In addition to adding and modifying objects/shapes, you should be able to delete shapes.
For this assignment, I have given you something to start with. This is a simple driver that allows addition and deletion of rectangles and ovals. After each command the list of current objects is printed. Your program should behave in a similar fashion. Of course in a real drawing program, the paint() method would take a Graphics object as a parameter instead of the PrintStream object passed in this test driver (System.out is of type java.io.PrintStream). Also in the real drawing program, the paint method would make appropriate drawing calls to the Graphics object, instead of just some print() method calls.
// You can use out just like you have been using System.out
public void paint(java.io.PrintStream out)
{
String s;
// code here to give s a value
out.print(s);
}