The package jcm/mod contains the science calculations, which are divided into modules. A "modlist" interface is implemented by all modules, helping them refer to each other. It also specifies the order for calculations, which are called by modloop.
This package is entirely independent of the graphical interface, and may be compiled and run without the other packages being present (in this case, some other input/output is needed, e.g. a simple text interface or hard-coded instructions e.g. testmod.java). This independence may later be useful for batch calculations which loop through the model many times without plotting graphics at every step, for example for probability analysis or solving optimisation problems.
The graphical interface package jcm/gui contains general components: graphs, menus, buttons, draggable controls, pop-up labels, layout manager and flowchart, event handler routines, etc. These should not refer to specific climate science modules (although they may refer to general structural elements).
The panels in package jcm/pan combine the general graphs and adjustable controls from jcm/gui with the model data and parameters from jcm/mod. Some contain extra options to implement more flexible graphs (e.g. regionplot), or unique features (e.g. the maps).
The package jcm/script will contain the code that records and plays back instruction sequences. This is currently intertwined with the gui, and not yet fully restored after recent restructuring (April 2002).
The root jcm/ directory includes "iob" (see below), the applet "mainapp", which initiates and contains the other jcm/gui components, and a simple static class "root", storing the codebase for loading files etc.
The class heirachy is as follows:
jcm/ interaction object (iob) | ||||||
jcm/mod | jcm/gui | |||||
module | param | popob | jcmpanel | |||
(science model calculations) | option | control | jcmchoice | simplegraph | ||
(params / popobs defined in modules or jcmpanels) |
graph | |||||
jcm/pan/ (custom panels -extend jcmpanel, define popobs, and refer to modules) |
Jcmpanel is the basic structure for a panel. Rather than extending the java.awt panel, which is not sufficiently flexible for JCM, jcmpanel transfers coordinates, layout and events from mainapp, and extends iob.
Simplegraph, extending jcmpanel, draws basic curves. Graph extends this, adding interactivity, legend and scales.
Layout arranges the panels. Flowchart contains a special layout with arrows showing the interactions.
An interface "thislayout" provides a static reference for the current layout, which contains an instance of panlist listing all the panels. Jcmpanels implement both this and the modlist interface, thus all panels can easily refer both to modules and to each other.
Popob is the superclass of option (on/off button), jcmchoice (menu) and control (draggable arrows). Popobs all refer to, but do not own, a param (scientific params are defined in modules, layout options in panels). Popob also contains methods for event handling and making pop-up info labels (hence the name).
The label text is stored by labinf, which loads data files for the specified language.