Due : 11am, December 12, 2003. (No Extensions).
There are many problems in Civil Engineering analysis that involve the synthesis of polygons, followed by the derivation of engineering properties (e.g., cross section area; moments of inertia; position of the centroid...).
Prototype Application
Figure 1 is a screendump from a prototype implementation for an engineering polygon viewer.
Figure 1. Screendump of Engineering Polygon Viewer
The graphical user interface is assembed from two panels. The center panel is a Canvas object, which can display all kinds of two-dimenasional graphics. This is where the polygon, the graphical axes, and textual strings can be drawn. A second panel positioned along the bottom of the interface contains four buttons;
1.0 1.0 1.0 5.0 5.0 5.0 5.0 3.0 4.0 3.0 3.0 2.0 3.0 1.0
The normal sequence of operational events is: (1) load the polygon, (2) draw the polygon, and (3) compute and print the polygon properties. However, all three steps can be executed by moving the cursor to the graphics canvas, pressing and then releasing the mouse button.
Links to Files
You should download the following files:
to a directory in your glue/wam account.
Compiling and Running the Program
To compile the program, simply type:
prompt >> javac PolygonGUI.java
The Java compiler will automatically establish the connection between PolygonGUI.java and PolygonAnalysis.java and generate bytecode files for both source code files. To run the program as a Java applet, type:
prompt >> appletviewer PolygonGUI.html
Things to Do
The prototype viewer is very incomplete. The purpose of our last assignment is to take the next couple of steps in the design and implementation of the polygon viewer.
prompt >> java PolygonAnalysis
Reorganize the source code in PolygonAnalysis.java so that these quantities are calculated in separate methods, and, can be called from PolygonGUI.java.
What to Hand in
Hand in printouts of your revised versions of PolygonGUI.java and PolygonAnalysis.java, and a screendump of the new graphical interface. Clearly indicated on the source code where you have modified/added new code ... this will help the grader.
This assignment is due on the last day of classes ... so if everything still isn't working, just hand in what you have, clearly indicating what works and what still needs to be implemented.
Developed in December 2003 by Mark Austin
Copyright © 2003, Department of Civil and Environmental Engineering, University of Maryland