datavisualizer.DetailedOutputLegend Class Reference

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...

Inheritance diagram for datavisualizer.DetailedOutputLegend:

datavisualizer.Legend

List of all members.

Public Member Functions

 DetailedOutputLegend (DetailedOutputFileManager oManager, String sTitle, String[] p_sSpeciesNames, int iMaxTimesteps) throws ModelException
 Constructor.
void actionPerformed (ActionEvent e)
 Responds to button presses.
void GoToTimestep (int iTimestep) throws javawrapper. ModelException
 Changes the display to the desired timestep.
int GetNumberOfTimesteps ()
 Gets the number of timesteps contained in this detailed output file.
void SetNumberOfTimesteps (int iNumTimesteps)
 Updates the legend with a new maximum number of timesteps.
int GetCurrentTimestep ()
 Gets the timestep currently being displayed.

Package Functions

DetailedOutputFileManager GetDetailedOutputFileManager ()
 Gets the file manager for this detailed output file.

Private Member Functions

void Step (int iDirection) throws ModelException
 Steps the model in the desired direction.
void Jump () throws ModelException
 Jumps the model to the timestep indicated in m_jJumpToTimestepField.
void Run (int iDirection) throws ModelException
 Runs the detailed output file continuously through the timesteps.

Private Attributes

JLabel m_jCurrentTimestepLabel = new JLabel()
 Label displaying current timestep.
JTextField m_jRateField = new JTextField("1")
 Field for the rate at which to step or run through the detailed output file.
JTextField m_jJumpToTimestepField = new JTextField("0")
 Field for the user to enter a particular timestep to jump to.
int m_iCurrentTimestep
 The timestep of the data currently being displayed.
int m_iMaxTimestep
 The maximum timestep for this file.
boolean m_bStop = false
 Flag for whether to stop when the file is running through timesteps.
boolean m_bRunning = false
 Flag for whether or not we're currently running.

Static Private Attributes

static final int FORWARD = 1
 Flag for moving forward through timesteps.
static final int BACKWARD = 2
 Flag for moving backward through timesteps.


Detailed Description

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: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

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)

Constructor & Destructor Documentation

datavisualizer.DetailedOutputLegend.DetailedOutputLegend ( DetailedOutputFileManager  oManager,
String  sTitle,
String[]  p_sSpeciesNames,
int  iMaxTimesteps 
) throws ModelException

Constructor.

Parameters:
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.
Exceptions:
ModelException If there is a problem drawing the window.


Member Function Documentation

void datavisualizer.DetailedOutputLegend.Step ( int  iDirection  )  throws ModelException [private]

Steps the model in the desired direction.

The model will be stepped the number of timesteps indicated in the rate field.

Parameters:
iDirection int Either FORWARD or BACKWARD.
Exceptions:
ModelException if the value in the rate field is not a positive number.

void datavisualizer.DetailedOutputLegend.Jump (  )  throws ModelException [private]

Jumps the model to the timestep indicated in m_jJumpToTimestepField.

Exceptions:
ModelException if the value in the jump to field is not a positive number.

void datavisualizer.DetailedOutputLegend.Run ( int  iDirection  )  throws ModelException [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.

Parameters:
iDirection int Direction to run in, either FORWARD or BACKWARD.
Exceptions:
ModelException if the value in the rate field is not a positive number.

void datavisualizer.DetailedOutputLegend.actionPerformed ( ActionEvent  e  ) 

Responds to button presses.

Parameters:
e ActionEvent

void datavisualizer.DetailedOutputLegend.GoToTimestep ( int  iTimestep  )  throws javawrapper. ModelException

Changes the display to the desired timestep.

If the requested timestep is beyond the boundaries of possible timesteps, nothing happens.

Parameters:
iTimestep int Timestep to display.
Exceptions:
ModelException if there is a problem updating charts.

int datavisualizer.DetailedOutputLegend.GetNumberOfTimesteps (  ) 

Gets the number of timesteps contained in this detailed output file.

Returns:
int Number of timesteps for this detailed output file.

void datavisualizer.DetailedOutputLegend.SetNumberOfTimesteps ( int  iNumTimesteps  ) 

Updates the legend with a new maximum number of timesteps.

Parameters:
iNumTimesteps int The new maximum number of timesteps.

int datavisualizer.DetailedOutputLegend.GetCurrentTimestep (  ) 

Gets the timestep currently being displayed.

Returns:
int the timestep currently being displayed.

DetailedOutputFileManager datavisualizer.DetailedOutputLegend.GetDetailedOutputFileManager (  )  [package]

Gets the file manager for this detailed output file.

Returns:
DetailedOutputFileManager The file manager for this detailed output file.


Member Data Documentation

Label displaying current timestep.

JTextField datavisualizer.DetailedOutputLegend.m_jRateField = new JTextField("1") [private]

Field for the rate at which to step or run through the detailed output file.

JTextField datavisualizer.DetailedOutputLegend.m_jJumpToTimestepField = new JTextField("0") [private]

Field for the user to enter a particular timestep to jump to.

The timestep of the data currently being displayed.

The maximum timestep for this file.

final int datavisualizer.DetailedOutputLegend.FORWARD = 1 [static, private]

Flag for moving forward through timesteps.

final int datavisualizer.DetailedOutputLegend.BACKWARD = 2 [static, private]

Flag for moving backward through timesteps.

Flag for whether to stop when the file is running through timesteps.

Flag for whether or not we're currently running.


The documentation for this class was generated from the following file:

Generated on Tue Apr 19 13:59:31 2011 for SORTIE Java Interface by  doxygen 1.5.6