CSE116A,B CSE 504 Introduction to Computer Science II for Majors Spring 1999

Project 2

Bina Ramamurthy




Problem Statement:

Chapter 2 of your text-book discusses a DrawShapes class with shapes rectangle, oval and round rectangle. It provides simple choices for different kinds of shapes. We will add draw line (curve) also to this list of possible shapes. We will also add the ability to store and load the drawing from an external source (disk). This facility will be available under a File menu item. Currently we do not have the ability to delete a item once it is drawn. Add the delete capability also. This will be under Edit menu. Edit menu item will also have an Add.

What to do?

  1. Study the example applet given in pages 45-49 thoroughly. Type it in and understand its operation.
  2. Make the necessary changes to turn it into an application. Save the DrawShapes application. This is one of the files required for submission.
  3. Go through a CRC card design to check how the design given varies from the one in the text. You may use your design for the next steps.
  4. Redesign Shape class to include other details you may need: For example, you may need an easy way of identifying an object to delete or an indexing mechanism (static table?) for locating a drawn shape.
  5. Change Vector to a LinkedList and modify the dependent methods to reflect this change.
  6. Add a class for line or curve shape. This will require keeping the points (coordinate pairs x,y) in a linked list or vector.
  7. Add menu items for File, Edit, Shapes, Help (which shows documentation, API and About the application details.)
  8. Enable the File load and store capabilities using Object Serialization facility of Java.
  9. Do incremental development: add the features in steps. After adding a feature make sure it works before moving on to the next.
  1. . You may develop the classes need in separate files. Main application, handling of the menu commands, and shapes hierarchy can be in different files.
  1. Document it and prepare the technical manual (Programmer's manual) and User's manual and other files as specified in the Documentation guidelines on the course homepage.
  2. Before submitting package all the files into a single .jar file using the command:

jar cf prj2.jar filename.java filename.xyz (complete names of all project2 files )

Submit the jar file. You are required to submit only one file the jar file. All the files you have for project2 will get packages into this file.

You may verify that you indeed have the right files without untaring but just looking at the files that makeup the package: use the command jar tf prj2.jar

Due Date:

3/31/99 by mid-night. The deadline will be strictly enforced. Late penalty will be 10% per day including week end days.