Graph Display Prototype 2005
In a moment, an applet window will pop up to illustrate the prototype!
This program was written as an Advanced Computer Science project:
Programming and design: Scott Kaelin, Rudy Clausen
About this program:
The original assignment was to create a system to perform unit conversions. The design idea was to make the program completely general, so that the addition of a single, small, class would suffice to add a new conversion into the system, and a request for a conversion would generate a search to find a path from the source unit to the desired unit. For example, a user might request a conversion from inches to kilometers, and the system would discover a path from inches to feet to miles to kilometers.
The project evolved to a graphical one in which the key problem became displaying an arbitrary collecting of vertices and edges (called a “graph” in mathematics) while avoiding crossing of edges, overlap of vertices, and, in general, laying the vertices out on the screen in a pleasing manner.
The current version is merely a demonstration. Note that moving the mouse over a vertex will cause the name of the unit to pop-up.
Key ideas:
Programming/Computer Science:
Use of a class hierarchy (Vertex, NamedVertex)
Use of packages to separate logic and display code.
Development of a mathematical tool class (Vector)
Development of project-specific collections based on standard Collection classes (BucketMap, TwoWayMap)
Representation of a graph as a linked structure.
Creation of Exception class (CannotConvertException).
Recursion to search for paths and analyze the graph for display.
Java:
Layout of Java components to serve needs of the project
Use of Java “tool tips” capability
Mouse interaction
March 5, 2005