Viewing
The Viewer is a
graphical panel that is used to display elections results using chart
and graphs. It can
be used in an applet embedded in an html document, displayed as a
standalone application or viewed in the gSwing GUI invoked from the Constituency
Tree.
On
initialisation it reads the serialised files created by the Extractor
and displays it in a number of canvases. As the user navigates
through the regions and constituencies the Viewer reads the region
serialised files as required.
Configuration
In the Viewer
section of
<gswing_home>/etc/properties.cfg there are keys representing
the colour of 10 parties:
To assign a
colour to a
party set the value to be the abbreviation of the party. For
example,
if the Goons Party had an abbreviation of GP and you wanted their
colour to be pink the entry would read:
party8=GP
Note:
These colours must be defined before the
extracting the serialised files.
Using the
Viewer
The standalone
viewer can be viewed by running the following command (In Windows
double click on the runGswing.bat file):
$
cd <gswing_home>/scripts
$
./runGSwing.sh
In the gSwing
GUI the Viewer is invoked from double clicking on a Constituency
Tree node.
The viewer displays the following information:
- Graph showing each party's performance over the span of the
database
Adding the
Viewer to a Web Page
To embed the
applet in a web page add the following lines to the html
document:
<applet
code="applet.AppletMain.class"
archive="applet-elec.jar"
width="930" height="560"></applet>