/** * Class p1info.java -- an information file for assignment 1 * in CS4812. This file is formatted as a .java file, with * extensive comment fields, so that it might be harmlessly * added to a project file in most popular IDEs. This allows * for more convenient consultation of the assignment * specifications during development. * */ class p1nfo { public static void main(String arg[]) { System.err.println ("This class does nothing!"); System.exit(1); } } //p1info /* CS 4812: "Stealth" JAVA! Programming Assignment 1 - Summer Quarter, 1998. Program Title: A Java Refresher Assigned: June 29, 1998 Design Doc Due: N/A, though recommended Program Due: July 13, 1998, before class FILE PROVIDED ============== You are provided two files for this assignment: o p1nfo.java - this file. o Dots.java - a data class file ** You may not modify this file DELIVERABLES (what you need to turn in) ====================================== o All source files created for this program, or modified by you (Once again, please do NOT modify the Dots.java file.) o Turn materials in using e-mail, or some other means that provides a time-stamp. LEARNING GOALS ============== o Brush up on basic Java syntax. o Familiarity with Java IO Package. o Gaining some comfort with basic 3D transformations (in anticipation of p2) *NOTE: The focus of this project is on object serialization; please don't get distracted by the 3D math. HEADER FILE =========== o Before beginning work, please create a header for your source files. You might find it convenient to use the file provided to CS1502 students. If you don't have a copy of this file, it is reprinted below: */ /** * CS1502: Program/Design Doc #XX * *
* Enter a brief description here * * Revisions: 1.0 DATE, 1998 * Created class XXXXX ** * @author YOUR NAME GOES HERE * @version Version 1.0, DATE, 1998 */ /* GENERAL OVERVIEW: CONSTRUCTING A SIMPLE MENU-DRIVEN IO PROGRAM ==================================================================== For this assignment, you will manipulate a data class to hold information about a 3D wire-frame object. Essentially the data class holds information about the object's coordinates (x, y, z), and a list of connected points. You are required to create a program that provides at least the following menu options: 1. Add/Remove points (x, y, and z coordinates) 2. Add/Remove vertices, connecting two known points 3. Display the array of points (if any have been entered), including original and transformed values. 4. Display/edit the radius of the points (all points must have the same radius) 5. Display the vertices, if any. 6. Rotate the points (with input for x, y, and z angles) 7. Save the points as a serialized object. 8. Load in serialized point array from disk, including the ability to select from a filtered directory listing. Each of these menu selections may require further menu options. (E.g., the choice of loading a serialized object may present the user with a directory listing of appropriate files; the decision to enter an array will require appropriate prompting, and a means of terminating input.) You decide how you will implement these details. To serialize the data, you must use the Dots.java file. You may use as many intermediary objects/classes as you like; however, the final serialized object must be an instance of "Dots.java". For examples on serialization, see the chapter on IO in Bruce Eckel's book. (You may find one or two other examples that help with other project details as well!) RESTRICTIONS ================== Many of you are familiar with the CS1502 utility file, "util.java". (This file is provided to CS1502 students to help with easy input and output.) You are not allowed to use this file in your program (though you may refer to the file for reference; please cite any use of code.) Consult the CS1502 web page for details: http://www.cc.gatech.edu/classes/cs1502/utilities.html RECOMMENDATIONS =================== You might consider using numerous classes in your design. Suggestions include: Driver.java ---------------- - instantiates the other objects, provides menu options, works as the interface between user and program. This file will keep track of the various objects. IOHelper.java ---------------- - an I/O utility file that reads directory listings, opens files as needed, serializes objects, etc. Dots.java ---------------- - a data class. Please do not modify this file. DotFilter.java ----------------- - a class extending an appropriate java.io class to help with filtering file names. HINTS ================ A few cautionary notes: a) Plan your menu options carefully. What happens the user deletes a point? Be sure to update the lines accordingly. b) Try to make your code as modular as possible. c) Have the program gracefully handle IO exceptions. Merely halting the program is not a useful means of addressing bad file names, corrupted files, etc. etc. You may even want to create your own exception to handle some of the details. d) The number of points in an object is flexible, so you might be tempted to use a Vector. However, since Dots.java uses arrays, you might get better results with the System.arraycopy() and clone() methods. Have a look at the source code for java.awt.Polygon for examples on dynamically sizing arrays. e) Comment your code carefully. P1 will emphasize javadoc comments. */