SORTIE Java Interface
1
|
This extends the legend class and adds some features specific to the viewing of detailed output files - specifically the ability to step through timesteps. More...
Public Member Functions | |
DetailedOutputLegend (DetailedOutputFileManager oManager, String sTitle, String[] p_sSpeciesNames, int iMaxTimesteps) throws ModelException | |
Constructor. More... | |
void | actionPerformed (ActionEvent e) |
Responds to button presses. More... | |
void | goToTimestep (int iTimestep) throws sortie.data.simpletypes.ModelException |
Changes the display to the desired timestep. More... | |
int | getNumberOfTimesteps () |
Gets the number of timesteps contained in this detailed output file. More... | |
void | setNumberOfTimesteps (int iNumTimesteps) |
Updates the legend with a new maximum number of timesteps. More... | |
int | getCurrentTimestep () |
Gets the timestep currently being displayed. More... | |
Public Member Functions inherited from sortie.datavisualizer.Legend | |
Legend (DataFileManager oManager, String sTitle, String[] p_sSpeciesNames) throws ModelException | |
Constructor. More... | |
Color | getSpeciesColor (int iIndex) throws ModelException |
Gets the color associated with a particular species. More... | |
Color | getSpeciesColor (String sName) throws ModelException |
Gets the color associated with a particular species. More... | |
boolean | getIsSpeciesSelected (int iIndex) throws ModelException |
Get whether or not a species' checkbox indicates that it is selected. More... | |
int | getNumberOfSpecies () |
Gets the total number of species for this legend. More... | |
void | actionPerformed (ActionEvent e) |
Triggered when a checkbox is toggled on or off. More... | |
String | getSpeciesCodeName (int i) throws ModelException |
Gets the internal code species name for a given species index. More... | |
String | getSpeciesDisplayName (int i) throws ModelException |
Gets the species display name for a given species index. More... | |
void | chooseColor (ActionEvent e) |
Displays the color chooser when the user clicks the color chooser button, and extracts the chosen color. More... | |
Private Member Functions | |
void | step (int iDirection) throws ModelException |
Steps the model in the desired direction. More... | |
void | jump () throws ModelException |
Jumps the model to the timestep indicated in m_jJumpToTimestepField. More... | |
void | run (int iDirection) throws ModelException |
Runs the detailed output file continuously through the timesteps. More... | |
Private Attributes | |
JLabel | m_jCurrentTimestepLabel = new JLabel() |
Label displaying current timestep. More... | |
JTextField | m_jRateField = new JTextField("1") |
Field for the rate at which to step or run through the detailed output file. More... | |
JTextField | m_jJumpToTimestepField = new JTextField("0") |
Field for the user to enter a particular timestep to jump to. More... | |
int | m_iCurrentTimestep |
The timestep of the data currently being displayed. More... | |
int | m_iMaxTimestep |
The maximum timestep for this file. More... | |
boolean | m_bStop = false |
Flag for whether to stop when the file is running through timesteps. More... | |
boolean | m_bRunning = false |
Flag for whether or not we're currently running. More... | |
Static Private Attributes | |
static final int | FORWARD = 1 |
Flag for moving forward through timesteps. More... | |
static final int | BACKWARD = 2 |
Flag for moving backward through timesteps. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from sortie.datavisualizer.Legend | |
void | createColorList () |
Creates the GUI and lays out all the components. More... | |
Protected Attributes inherited from sortie.datavisualizer.Legend | |
String [] | mp_sSpeciesNames |
The names of each of the species. More... | |
String [] | mp_sDisplayNames |
The names that will be displayed. More... | |
Color [] | mp_oSpeciesColors |
The color for each species. More... | |
JButton [] | mp_jSpeciesColorDisplays |
The color display for each species. More... | |
JCheckBox [] | mp_jSpeciesChecks |
Checkboxes indicating whether or not a species should be visible. More... | |
DataFileManager | m_oManager |
Parent data file manager. More... | |
This extends the legend class and adds some features specific to the viewing of detailed output files - specifically the ability to step through timesteps.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
December 8, 2004: Added more run controls (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
sortie.datavisualizer.DetailedOutputLegend.DetailedOutputLegend | ( | DetailedOutputFileManager | oManager, |
String | sTitle, | ||
String [] | p_sSpeciesNames, | ||
int | iMaxTimesteps | ||
) | throws ModelException |
Constructor.
oManager | Parent detailed output file manager. |
sTitle | Title to display in window. |
p_sSpeciesNames | List of species names. |
iMaxTimesteps | Maximum number of timesteps in this detailed output file. |
ModelException | If there is a problem drawing the window. |
void sortie.datavisualizer.DetailedOutputLegend.actionPerformed | ( | ActionEvent | e | ) |
Responds to button presses.
e | ActionEvent |
int sortie.datavisualizer.DetailedOutputLegend.getCurrentTimestep | ( | ) |
Gets the timestep currently being displayed.
int sortie.datavisualizer.DetailedOutputLegend.getNumberOfTimesteps | ( | ) |
Gets the number of timesteps contained in this detailed output file.
void sortie.datavisualizer.DetailedOutputLegend.goToTimestep | ( | int | iTimestep | ) | throws sortie.data.simpletypes.ModelException |
Changes the display to the desired timestep.
If the requested timestep is beyond the boundaries of possible timesteps, nothing happens.
iTimestep | int Timestep to display. |
ModelException | if there is a problem updating charts. |
|
private |
Jumps the model to the timestep indicated in m_jJumpToTimestepField.
ModelException | if the value in the jump to field is not a positive number. |
|
private |
Runs the detailed output file continuously through the timesteps.
It will jump at the rate specified in the m_jRateField field. This will put the running in a separate thread so we can listen if the user wants to stop.
iDirection | int Direction to run in, either FORWARD or BACKWARD. |
ModelException | if the value in the rate field is not a positive number. |
void sortie.datavisualizer.DetailedOutputLegend.setNumberOfTimesteps | ( | int | iNumTimesteps | ) |
Updates the legend with a new maximum number of timesteps.
iNumTimesteps | int The new maximum number of timesteps. |
|
private |
Steps the model in the desired direction.
The model will be stepped the number of timesteps indicated in the rate field.
iDirection | int Either FORWARD or BACKWARD. |
ModelException | if the value in the rate field is not a positive number. |
|
staticprivate |
Flag for moving backward through timesteps.
|
staticprivate |
Flag for moving forward through timesteps.
|
private |
Flag for whether or not we're currently running.
|
private |
Flag for whether to stop when the file is running through timesteps.
|
private |
The timestep of the data currently being displayed.
|
private |
The maximum timestep for this file.
|
private |
Label displaying current timestep.
|
private |
Field for the user to enter a particular timestep to jump to.
|
private |
Field for the rate at which to step or run through the detailed output file.