CS 132: Intro to Computer Science II

Spring 1999

Assignment 2

Drawing with Graphics Objects

Due Monday February 1

Part 1

Copy the files in ~miller/cs132/lab2 and place them in your cs132/lab2 directory. The file Draw.java is an example program that uses the DrawFrame and Graphics classes to permit a user to draw rectangles in a separate window.

Your assignment is to design and implement a small drawing program, which allows users to interact with a text-based interface to create drawings on a separate frame. The text-based interface should offer the user options for drawing objects, clearing the screen, and selecting new colors. The program should continue offering options until the user chooses to exit the program.

In implementing your program, you will take advantage of the concepts in chapter four, which include if statements, switch statements, and boolean expressions. You will only need to modify code inside of the drawObject method, which currently only draws rectangles. Your program does not have to use any additional loops other than the one already present in the example program.

You are generally free to design your own drawing program. Your goal should be to create a flexible, versatile application that is yet easy to use. At minimum, the program should provide the following functions:

Designing a highly usable program is not always easy. Here are some guidelines for creating an effective application (adapted from Jakob Nielsen's Usability Engineering):

Submission

On the due date, you should turn your copy of Draw.java, a script of you testing and showing your program's features, and a snapshot of your handiwork. The snapshot can be created by using the snapshot program and then printing to the lab4hp printer.