datavisualizer::StandTableDataRequest Class Reference

Writes a stand table for a detailed output file (basal area or density for each life history stage throughout the run). More...

Inheritance diagram for datavisualizer::StandTableDataRequest:

datavisualizer::DataRequest List of all members.

Public Member Functions

 StandTableDataRequest (DetailedOutputFileManager oManager, String sChartName, int iTableType)
 Constructor.
void actionPerformed (java.awt.event.ActionEvent oEvent)
 Respons to the button clicks for this class's chart window.
boolean WantAnyTreeFloats ()
 This wants diameter values for all trees.
void AddTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode)
 Accepts a tree float data member code.
void AddTreeFloatData (int iSpecies, int iType, int iCode, float fVal)
 Accepts a tree float data member value.

Static Public Attributes

static final int BASAL_AREA = 1
 Basal area stand table.
static final int DENSITY = 2
 Density stand table.

Protected Member Functions

void WriteTables () throws javawrapper.ModelException
 This writes the tables.
void WriteChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException
 Saves the data in the current table as a tab-delimited text file.

Package Functions

void UpdateChart (Legend oLegend) throws javawrapper.ModelException
 Does nothing unless the number of timesteps is different, in which case the table is recreated.
ModelInternalFrame DrawChart (Legend oLegend, String sChartTitle) throws javawrapper.ModelException
 Draws the table.
void ClearData () throws javawrapper.ModelException
 Does nothing, because this table doesn't operate on the detailed output file timescale.

Detailed Description

Writes a stand table for a detailed output file (basal area or density for each life history stage throughout the run).

The tabulation of density and basal area data is based on the DBH value for each tree life history stage (so seedlings aren't allowed). For density, the number of diameter values encountered is counted; for basal area, the individual basal areas calculated from DBH are totaled. All values are displayed in per hectare units. These values are broken up by size class as specified by the user. The average height of the tallest trees will also be included in the table if height was saved in the detailed output file.

This chart is different from other charts in that it displays data from all timesteps at once, instead of one timestep at a time. Thus, it tends to ignore normal chart drawing requests and has its own code to force parsing of all timestep files in a detailed output package at once.

Technically, density data could be extracted from any tree data member, since counting up the total is all that is required. I didn't do it that way because I'm a little lazy, and I'll wait for a hue and cry from the users before unnecessarily complicating my code.

Copyright: Copyright (c) Charles D. Canham 2003 Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
October 29, 2004: Created (LEM)
November 18, 2004: Updated for real-time data visualization (LEM)
June 14, 2005: Added mean DBH column (LEM)
March 23, 2006: Added species-specific tables (LEM)


Constructor & Destructor Documentation

datavisualizer::StandTableDataRequest::StandTableDataRequest ( DetailedOutputFileManager  oManager,
String  sChartName,
int  iTableType 
) [inline]

Constructor.

Declares all the arrays.

Parameters:
oManager Parent detailed output file manager
sChartName Name of the table being drawn.
iTableType Type of table, either density or basal area. The value must be either BASAL_AREA or DENSITY.

Edit history:
------------------
October 29, 2004: Created (LEM)
March 23, 2006: Updated with species-specific stuff (LEM)


Member Function Documentation

void datavisualizer::StandTableDataRequest::actionPerformed ( java.awt.event.ActionEvent  oEvent  )  [inline]

Respons to the button clicks for this class's chart window.

Parameters:
oEvent ActionEvent Event to process.

Reimplemented from datavisualizer::DataRequest.

void datavisualizer::StandTableDataRequest::WriteTables (  )  throws javawrapper.ModelException [inline, protected]

This writes the tables.

It forces the DetailedOutputFileManager to move through each timestep so the data can be collected. Then it formats the table into the chart window.

Exceptions:
ModelException if there is a problem parsing the data.

void datavisualizer::StandTableDataRequest::UpdateChart ( Legend  oLegend  )  throws javawrapper.ModelException [inline, package, virtual]

Does nothing unless the number of timesteps is different, in which case the table is recreated.

This chart does not respond to regular chart update events, since it already shows data for all timesteps.

Parameters:
oLegend Legend The legend for this chart.
Exceptions:
ModelException Won't be thrown.

Edit history:
------------------
October 29, 2004: Created (LEM)
November 18, 2004: Updated for real-time data visualization (LEM)

Implements datavisualizer::DataRequest.

void datavisualizer::StandTableDataRequest::WriteChartDataToFile ( java.io.FileWriter  jOut  )  throws java.io. IOException [inline, protected, virtual]

Saves the data in the current table as a tab-delimited text file.

Parameters:
jOut java.io.FileWriter The file to write to.
Exceptions:
java.io.IOException if there is a problem writing the file.

Edit history:
------------------
November 2, 2004: Created (LEM)
March 23, 2006: Changed to make species-specific (LEM)

Implements datavisualizer::DataRequest.

ModelInternalFrame datavisualizer::StandTableDataRequest::DrawChart ( Legend  oLegend,
String  sChartTitle 
) throws javawrapper.ModelException [inline, package, virtual]

Draws the table.

Initially, there will be no table; just a place for a user to enter size class information.

Parameters:
oLegend Legend Legend for this chart.
sChartTitle String Chart name for the window title.
Exceptions:
ModelException Passed through from other called methods - this method doesn't throw it.
Returns:
JInternalFrame The finished chart window.

Edit history:
------------------
October 29, 2004: Created (LEM)

Implements datavisualizer::DataRequest.

void datavisualizer::StandTableDataRequest::ClearData (  )  throws javawrapper.ModelException [inline, package, virtual]

Does nothing, because this table doesn't operate on the detailed output file timescale.

Exceptions:
ModelException Won't throw it.

Edit history:
------------------
October 29, 2004: Created (LEM)

Implements datavisualizer::DataRequest.

boolean datavisualizer::StandTableDataRequest::WantAnyTreeFloats (  )  [inline]

This wants diameter values for all trees.

Returns:
boolean Set to true.

Edit history:
------------------
October 29, 2004: Created (LEM)

Reimplemented from datavisualizer::DataRequest.

void datavisualizer::StandTableDataRequest::AddTreeFloatDataMemberCode ( int  iSpecies,
int  iType,
String  sLabel,
int  iCode 
) [inline]

Accepts a tree float data member code.

We're looking for DBH and height.

Parameters:
iSpecies The species for which this is a data member.
iType The tree type for which this is a data member.
sLabel The label of the data member.
iCode The data member code.

Edit history:
------------------
October 29, 2004: Created (LEM)

Reimplemented from datavisualizer::DataRequest.

void datavisualizer::StandTableDataRequest::AddTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
float  fVal 
) [inline]

Accepts a tree float data member value.

If it matches our code, we'll increment either the density count (if m_iTableType = DENSITY) or the basal area total.

Parameters:
iSpecies Species of the tree from which this value came.
iType Type of the tree from which this value came.
iCode Data member code of this value.
fVal Value.

Edit history:
------------------
October 29, 2004: Created (LEM)

Reimplemented from datavisualizer::DataRequest.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:34:52 2007 for SORTIE Java Interface by  doxygen 1.5.2