datavisualizer.WindstormDataRequest Class Reference

Produces a table of windstorm results. More...

Inheritance diagram for datavisualizer.WindstormDataRequest:

datavisualizer.DataRequest

List of all members.

Public Member Functions

 WindstormDataRequest (String sChartName, DetailedOutputFileManager oManager) throws ModelException
 Constructor.
void AddGridPackageFloatData (String sGridName, int iX, int iY, int iCode, float fVal)
 This accepts a package float value.
boolean WantAnyGridPackageFloats ()
 This wants package floats.
void AddGridPackageFloatDataMemberCode (String sGridName, String sLabel, int iCode)
 Accepts a grid package float data member code for future reference when passed float data members.
void EndPackage ()
 Processing to occur after we've received a package.

Protected Member Functions

void WriteChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException
 Writes the table's data to tab-delimited text.
JPanel CreateTable ()
 Turns the accumulated data into a table for viewing.

Package Functions

ModelInternalFrame DrawChart (Legend oLegend, String sChartTitle) throws ModelException
 Creates a table of the results that have been collected.
void UpdateChart (Legend oLegend) throws ModelException
 Redraws the chart using the existing dataset.
void ClearData () throws ModelException
 Clears out existing data.

Private Member Functions

int GetSpeciesFromDataMemberLabel (String sLabel)
 Gets the species from a data member label which ends in "_x", where x is the species number.

Private Attributes

Vector< String[]> m_oTableData = new Vector<String[]>(0)
 Holds data until it's ready to be displayed.
float[] mp_fDensity
 The density killed for this storm for each species.
float[] mp_fBasalArea
 The basal area killed for this storm for each species.
int[] mp_iDensityIndexes
 Translates a data member code to an index in the density array.
int[] mp_iBasalAreaIndexes
 Translates a data member code to an index in the basal area array.
String m_sThisGrid
 Name of the grid from which the data will be collected.
float m_fStormSeverity
 Severity of the current storm.
int m_iNumSpecies
 The number of species.
int m_iSeverityCode
 Index code for storm severity.
int m_iNumCols = 3
 Number of columns in the table.


Detailed Description

Produces a table of windstorm results.

A windstorm table requires the detailed output file to have data saved from the "Windstorm Results" grid.

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

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
March 20, 2006: Created (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Constructor & Destructor Documentation

datavisualizer.WindstormDataRequest.WindstormDataRequest ( String  sChartName,
DetailedOutputFileManager  oManager 
) throws ModelException

Constructor.

Parameters:
sChartName Name of the chart
oManager Detailed output file manager
Exceptions:
ModelException not really, but I have to declare this.

Edit history:
------------------
March 20, 2006: Created (LEM)


Member Function Documentation

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

Writes the table's data to tab-delimited text.

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

Implements datavisualizer.DataRequest.

void datavisualizer.WindstormDataRequest.AddGridPackageFloatData ( String  sGridName,
int  iX,
int  iY,
int  iCode,
float  fVal 
)

This accepts a package float value.

It figures out what it is, then adds it to the appropriate location.

Parameters:
sGridName Name of the grid for this data
iX X number of the cell from which this value came
iY Y number of the cell from which this value came
iCode Data member code of this value.
fVal Value.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.WindstormDataRequest.WantAnyGridPackageFloats (  ) 

This wants package floats.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.WindstormDataRequest.AddGridPackageFloatDataMemberCode ( String  sGridName,
String  sLabel,
int  iCode 
)

Accepts a grid package float data member code for future reference when passed float data members.

Parameters:
sGridName Name of the grid
sLabel The label of the data member.
iCode The data member code.

Reimplemented from datavisualizer.DataRequest.

int datavisualizer.WindstormDataRequest.GetSpeciesFromDataMemberLabel ( String  sLabel  )  [private]

Gets the species from a data member label which ends in "_x", where x is the species number.

Parameters:
sLabel The data member label.
Returns:
The species number, or -1 if none exists.

ModelInternalFrame datavisualizer.WindstormDataRequest.DrawChart ( Legend  oLegend,
String  sChartTitle 
) throws ModelException [package, virtual]

Creates a table of the results that have been collected.

Parameters:
oLegend The species legend.
sChartTitle The chart title.
Returns:
A JInternalFrame with the table present in it.
Exceptions:
datavisualizer.ModelException 
Edit history:
------------------
March 20, 2006: Created (LEM)

Implements datavisualizer.DataRequest.

void datavisualizer.WindstormDataRequest.UpdateChart ( Legend  oLegend  )  throws ModelException [package, virtual]

Redraws the chart using the existing dataset.

Parameters:
oLegend The legend for this chart.
Exceptions:
ModelException if anything goes wrong with the chart drawing.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)

Implements datavisualizer.DataRequest.

JPanel datavisualizer.WindstormDataRequest.CreateTable (  )  [protected]

Turns the accumulated data into a table for viewing.

Returns:
JPanel The panel containing the table.

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

Clears out existing data.

Exceptions:
ModelException Doesn't throw an exception.

Edit history:
------------------
March 20, 2006: Created (LEM)

Implements datavisualizer.DataRequest.

void datavisualizer.WindstormDataRequest.EndPackage (  ) 

Processing to occur after we've received a package.

This takes the data and formats it into text strings, which it arranges into m_oTableData, ready to display in a table.

Reimplemented from datavisualizer.DataRequest.


Member Data Documentation

Vector<String[]> datavisualizer.WindstormDataRequest.m_oTableData = new Vector<String[]>(0) [private]

Holds data until it's ready to be displayed.

Since we don't know how many storms we'll have each timestep, this is a vector. Every time we get to the end of a package, the results of that package will be written here. Each vector element is an array of strings with three elements, for the three columns. They may be empty.

The density killed for this storm for each species.

The basal area killed for this storm for each species.

Translates a data member code to an index in the density array.

The array index is the species number; the value in the array is the code.

Translates a data member code to an index in the basal area array.

The array index is the species number; the value in the array is the code.

Name of the grid from which the data will be collected.

Severity of the current storm.

The number of species.

Index code for storm severity.

Number of columns in the table.


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

Generated on Wed Oct 28 14:01:18 2009 for SORTIE Java Interface by  doxygen 1.5.6