Eikosogram (Java GUI Application) code description
This file contains a description of the java source code for the
eikosogram program. First, download the
(a java archive named sourceCode.jar)
The contents of the sourceCode.jar file are seen via:
jar -tf sourceCode.jar
and extracted via
jar -xf sourceCode.jar
Changes can then be made to the source *.java files as appropriate.
Description of source code
Details on the design of the code can be found in the University of
Waterloo M.Math (Statistics - Computing) Master's
Essay by Glenn Lee (supervisor R.W. Oldford).
This application contains six classes:
- Eikosogram (main class) - To construct the main frame, read data file and generate graphs.
- EikosoCanvas - To calculate and paint graphs, define water container simulation functions.
- EikosoRec - Each rectangle has locations (x&y coordinates),width,height,color and the corresponding variable values.
- EikosoBarrier - Each barrier has an index and a flag to indicate if the barrier being removed or not.
- EikosoInternalFrm - Place holder for EikosoCanvas.
- Fraction - To define fractional computation including add,subtract,multiply and divide.
Creating an executable JAR file:
Suppose that changes have been made to the source *.java files and we want
to recreate a new jar file, say eikos-new.jar,
Now the new version can be run by typing:
- First compile the new java code, thus generating all class files.
- Create a text file named eikosogram.mf containing the following 2 lines:
Note that this file has been created and is part of the sourceCode.jar archive; it is
located in the directory META-INF and is named MANIFEST.MF This file can just be copied
into the directory containing the source code and naming it eikosogram.mf.
- Type the following command at the command line:
or, to include the source as well,
jar cmf eikosogram.mf eikos-new.jar *.class
jar cmf eikosogram.mf eikos-new.jar *.class *.java
or launched by simply double-clicking the eikos-new.jar file.
java -jar eikos-new.jar