datavisualizer.StockTableDataRequest Class Reference

Writes a stock table for a detailed output file. More...

Inheritance diagram for datavisualizer.StockTableDataRequest:

datavisualizer.DataRequest

List of all members.

Public Member Functions

 StockTableDataRequest (DetailedOutputFileManager oManager, String sChartName)
 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.

Protected Member Functions

void GetDataAndMakeTables () 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.

Private Member Functions

Object[][] CreateTable (int iSpecies)
 Creates the table for display.
JPanel MakeTablePanel (int iSpecies) throws javawrapper.ModelException
 Makes a panel with a table for a species.
JPanel MakeSizeClassPanel () throws javawrapper.ModelException
 Makes the panel containing the size class and species controls.

Private Attributes

DetailedOutputLegend m_oLegend = null
 The legend for the detailed output file whose data goes in the table.
double[][][] mp_fLiveTreeVolumeTotals = null
 Live tree volume totals - species by timesteps by size classes.
double[][][] mp_fSnagVolumeTotals = null
 Snag volume totals - species by timesteps by size classes.
long[][][] mp_iLiveTreeCounts = null
 Live tree counts - species by timesteps by size classes.
long[][][] mp_iSnagCounts = null
 Snag counts - species by timesteps by size classes.
double[][] mp_fLiveTreeDBHTotal
 Live tree DBH totals, for mean DBH - species by timesteps.
double[][] mp_fSnagDBHTotal
 Snag DBH totals, for mean DBH - species by timesteps.
float[][][] mp_fTallestLiveTrees
 Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
float[][][] mp_fTallestSnags
 Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.
int[][] mp_iDbhCode
 Holds the data codes for DBH.
int[][] mp_iVolumeCode
 Holds the data codes for volume.
int[][] mp_iHeightCode
 Holds the data codes for height.
JComboBox m_jSpeciesBox
 Box that holds our species list.
String[] mp_sHeaders
 Column headers.
JTextField m_jNumSizeClasses = new JTextField("10")
 Field displaying the number of bins in the histogram.
JTextField m_jSizeClassSize = new JTextField("5.0")
 Field displaying the bin size in the histogram.
float[] mp_fSizeClasses
 List of size class upper boundaries.
float m_fPlotAreaInHectares
 Area of the plot, in hectares.
float m_fNumYearsPerTimestep
 Number of years per timestep.
float m_fSizeClassSize = (float) 5.0
 Size of DBH size classes, in cm.
float m_fDbh
 Current DBH value to be matched to volume.
float m_fVolume = -1
 Current volume value to be matched to DBH.
int m_iNumSpecies
 Number of total species.
int m_iNumSizeClasses = 10
 Number of DBH size classes to display in table.
int m_iCurrentTimestep = -1
 The current timestep.
int m_iNumTimesteps = -1
 The total number of timesteps.
boolean m_bFirstTime = true
 So we can display the first time.
boolean m_bIncludeLive = true
 Whether to include live trees.
boolean m_bIncludeSnags = true
 Whether to include snags.


Detailed Description

Writes a stock table for a detailed output file.

The stock table displays volume data for a run as well as differences from the previous timestep. All values are displayed in cubic meters per hectare units. These values are broken up by size class as specified by the user. 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.

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

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
November 2, 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)
March 16, 2011: Added split of snags and live trees (LEM)

Constructor & Destructor Documentation

datavisualizer.StockTableDataRequest.StockTableDataRequest ( DetailedOutputFileManager  oManager,
String  sChartName 
)

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.


Member Function Documentation

void datavisualizer.StockTableDataRequest.actionPerformed ( java.awt.event.ActionEvent  oEvent  ) 

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

Parameters:
oEvent ActionEvent Event to process.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.StockTableDataRequest.GetDataAndMakeTables (  )  throws javawrapper.ModelException [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.

Object [][] datavisualizer.StockTableDataRequest.CreateTable ( int  iSpecies  )  [private]

Creates the table for display.

Returns:
Table data.

JPanel datavisualizer.StockTableDataRequest.MakeTablePanel ( int  iSpecies  )  throws javawrapper.ModelException [private]

Makes a panel with a table for a species.

Parameters:
iSpecies int iSpecies; if equal to m_iNumSpecies, shows the plot totals.
Returns:
JPanel Panel with the formatted table
Exceptions:
javawrapper.ModelException if there is an unrecognized species number

void datavisualizer.StockTableDataRequest.UpdateChart ( Legend  oLegend  )  throws javawrapper.ModelException [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.

Implements datavisualizer.DataRequest.

void datavisualizer.StockTableDataRequest.WriteChartDataToFile ( java.io.FileWriter  jOut  )  throws java.io. IOException [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.

Implements datavisualizer.DataRequest.

ModelInternalFrame datavisualizer.StockTableDataRequest.DrawChart ( Legend  oLegend,
String  sChartTitle 
) throws javawrapper.ModelException [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.

Implements datavisualizer.DataRequest.

void datavisualizer.StockTableDataRequest.ClearData (  )  throws javawrapper.ModelException [package, virtual]

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

Exceptions:
ModelException Won't throw it.

Implements datavisualizer.DataRequest.

JPanel datavisualizer.StockTableDataRequest.MakeSizeClassPanel (  )  throws javawrapper.ModelException [private]

Makes the panel containing the size class and species controls.

Returns:
JPanel Panel containing the size class and species controls.
Exceptions:
javawrapper.ModelException passing through from called functions; shouldn't ever be thrown.

boolean datavisualizer.StockTableDataRequest.WantAnyTreeFloats (  ) 

This wants diameter values for all trees.

Returns:
boolean Set to true.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.StockTableDataRequest.AddTreeFloatDataMemberCode ( int  iSpecies,
int  iType,
String  sLabel,
int  iCode 
)

Accepts a tree float data member code.

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.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.StockTableDataRequest.AddTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
float  fVal 
)

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.

Reimplemented from datavisualizer.DataRequest.


Member Data Documentation

The legend for the detailed output file whose data goes in the table.

Live tree volume totals - species by timesteps by size classes.

Snag volume totals - species by timesteps by size classes.

Live tree counts - species by timesteps by size classes.

Snag counts - species by timesteps by size classes.

Live tree DBH totals, for mean DBH - species by timesteps.

Snag DBH totals, for mean DBH - species by timesteps.

Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.

Sorted list of the tallest trees: array 1 = species, array 2 = timesteps, array 3 = list of tree heights.

Holds the data codes for DBH.

Array indexes are #1 - type and #2 - species.

Holds the data codes for volume.

Array indexes are #1 - type and #2 - species.

Holds the data codes for height.

Array indexes are #1 - type and #2 - species.

Box that holds our species list.

Column headers.

JTextField datavisualizer.StockTableDataRequest.m_jNumSizeClasses = new JTextField("10") [private]

Field displaying the number of bins in the histogram.

JTextField datavisualizer.StockTableDataRequest.m_jSizeClassSize = new JTextField("5.0") [private]

Field displaying the bin size in the histogram.

List of size class upper boundaries.

Sized m_iNumSizeClasses.

Area of the plot, in hectares.

Number of years per timestep.

Size of DBH size classes, in cm.

Current DBH value to be matched to volume.

Current volume value to be matched to DBH.

Number of total species.

Number of DBH size classes to display in table.

The current timestep.

This helps process an entire detailed output file. It also lets this class know when to ignore offered data - whenever this value is set to -1, some other chart event triggered the parse.

Reimplemented from datavisualizer.DataRequest.

The total number of timesteps.

We keep track of this so we know if something has changed (as in real-time data visualization) so we can update appropriately.

So we can display the first time.

Whether to include live trees.

Whether to include snags.


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

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