SORTIE Java Interface  1
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
sortie.datavisualizer.LineGraphDataRequest Class Reference

Creates different types of line graphs for detailed output files. More...

Inheritance diagram for sortie.datavisualizer.LineGraphDataRequest:
sortie.datavisualizer.DataRequest

Public Member Functions

 LineGraphDataRequest (DetailedOutputFileManager oManager, String sChartName, int iChartType, int iTreeType, int iDeadCode)
 Constructor. More...
 
void outputFileParseFinished (boolean bBatchMode)
 This will be called for all open data requests after output file parsing is completed. More...
 
boolean wantAnyTreeFloats ()
 This wants diameter values for all trees. More...
 
boolean wantAnyDeadTreeFloats ()
 This wants diameter values for all trees. More...
 
void addTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode)
 Accepts a tree float data member code. More...
 
void addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode)
 Accepts a tree float data member value. More...
 
void addDeadTreeFloatData (int iSpecies, int iType, int iCode, int iDeadCode, float fVal, boolean bBatchMode)
 Accepts a tree float data member value. More...
 
void actionPerformed (java.awt.event.ActionEvent oEvent)
 Performs actions for the controls in the Histogram window. More...
 
- Public Member Functions inherited from sortie.datavisualizer.DataRequest
 DataRequest (String sChartName, DetailedOutputFileManager oManager)
 Constructor. More...
 
void setCurrentTimestep (int iTimestep)
 Sets the current time step. More...
 
void actionPerformed (java.awt.event.ActionEvent oEvent)
 If passed the order to write chart data, does it. More...
 
void extractBatchSetupInfo (ChartInfo oInfo) throws ModelException
 Extracts information needed by the data request from the controls panel displayed to the user. More...
 
boolean isFileWritingExternallyManaged ()
 Gets whether or not file writing is externally managed for this data request or whether it takes care of everything itself. More...
 
void getReadyForTimestepParse (int iTimestep, boolean bBatchMode) throws ModelException
 This will be called for all open data requests just before time step parsing begins. More...
 
void timestepParseFinished (boolean bBatchMode) throws ModelException
 This will be called for all open data requests after time step parsing is completed. More...
 
void outputFileParseFinished (boolean bBatchMode)
 This will be called for all open data requests after output file parsing is completed. More...
 
void saveChartDataToFile (boolean bJustCurrTS)
 Writes a chart's data to a file. More...
 
String getChartName ()
 Get the name of the chart. More...
 
JInternalFrame getChart ()
 Get the chart frame. More...
 
boolean wantAnyTreeFloats ()
 Whether or not this object wants any tree float data members. More...
 
boolean wantAnyTreeInts ()
 Whether or not this object wants any tree int data members. More...
 
boolean wantAnyTreeChars ()
 Whether or not this object wants any tree char data members. More...
 
boolean wantAnyTreeBools ()
 Whether or not this object wants any tree bool data members. More...
 
boolean wantAnyDeadTreeFloats ()
 Whether or not this object wants any dead tree float data members. More...
 
boolean wantAnyDeadTreeInts ()
 Whether or not this object wants any dead tree int data members. More...
 
boolean wantAnyDeadTreeChars ()
 Whether or not this object wants any dead tree char data members. More...
 
boolean wantAnyDeadTreeBools ()
 Whether or not this object wants any dead tree bool data members. More...
 
boolean wantAnyGridFloats ()
 Whether or not this object wants any grid float data members. More...
 
boolean wantAnyGridInts ()
 Whether or not this object wants any grid int data members. More...
 
boolean wantAnyGridChars ()
 Whether or not this object wants any grid char data members. More...
 
boolean wantAnyGridBools ()
 Whether or not this object wants any grid bool data members. More...
 
boolean wantAnyGridPackageFloats ()
 Whether or not this object wants any grid package float data members. More...
 
boolean wantAnyGridPackageInts ()
 Whether or not this object wants any grid package int data members. More...
 
boolean wantAnyGridPackageChars ()
 Whether or not this object wants any grid package char data members. More...
 
boolean wantAnyGridPackageBools ()
 Whether or not this object wants any grid package bool data members. More...
 
void addTreeFloatData (int iSpecies, int iType, int iCode, float fVal, boolean bBatchMode) throws SAXException
 Accepts a piece of tree float data from the parser. More...
 
void addTreeIntData (int iSpecies, int iType, int iCode, int iVal, boolean bBatchMode) throws SAXException
 Accepts a piece of tree int data from the parser. More...
 
void addTreeCharData (int iSpecies, int iType, int iCode, String sVal, boolean bBatchMode) throws SAXException
 Accepts a piece of tree char data from the parser. More...
 
void addTreeBoolData (int iSpecies, int iType, int iCode, boolean bVal, boolean bBatchMode) throws SAXException
 Accepts a piece of tree bool data from the parser. More...
 
void addDeadTreeFloatData (int iSpecies, int iType, int iCode, int iDeadCode, float fVal, boolean bBatchMode) throws SAXException
 Accepts a piece of dead tree float data from the parser. More...
 
void addDeadTreeIntData (int iSpecies, int iType, int iCode, int iDeadCode, int iVal, boolean bBatchMode) throws SAXException
 Accepts a piece of dead tree int data from the parser. More...
 
void addDeadTreeCharData (int iSpecies, int iType, int iCode, int iDeadCode, String sVal, boolean bBatchMode) throws SAXException
 Accepts a piece of dead tree char data from the parser. More...
 
void addDeadTreeBoolData (int iSpecies, int iType, int iCode, int iDeadCode, boolean bVal, boolean bBatchMode) throws SAXException
 Accepts a piece of dead tree bool data from the parser. More...
 
void addGridFloatData (String sGridName, int iX, int iY, int iCode, float fVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid float data from the parser. More...
 
void addGridIntData (String sGridName, int iX, int iY, int iCode, int iVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid int data from the parser. More...
 
void addGridCharData (String sGridName, int iX, int iY, int iCode, String sVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid char data from the parser. More...
 
void addGridBoolData (String sGridName, int iX, int iY, int iCode, boolean bVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid bool data from the parser. More...
 
void addGridPackageFloatData (String sGridName, int iX, int iY, int iCode, float fVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid package float data from the parser. More...
 
void addGridPackageIntData (String sGridName, int iX, int iY, int iCode, int iVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid package int data from the parser. More...
 
void addGridPackageCharData (String sGridName, int iX, int iY, int iCode, String sVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid package char data from the parser. More...
 
void addGridPackageBoolData (String sGridName, int iX, int iY, int iCode, boolean bVal, boolean bBatchMode) throws SAXException
 Accepts a piece of grid package bool data from the parser. More...
 
void endPackage () throws SAXException
 Announces a package has ended. More...
 
void endTree (boolean bBatchMode) throws SAXException
 Announces a tree record has ended. More...
 
void addTreeFloatDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException
 Accepts a tree float data member code for future reference when passed float data members. More...
 
void addTreeIntDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException
 Accepts a tree int data member code for future reference when passed int data members. More...
 
void addTreeCharDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException
 Accepts a tree char data member code for future reference when passed char data members. More...
 
void addTreeBoolDataMemberCode (int iSpecies, int iType, String sLabel, int iCode) throws SAXException
 Accepts a tree bool data member code for future reference when passed bool data members. More...
 
void addGridFloatDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid float data member code for future reference when passed float data members. More...
 
void addGridIntDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid int data member code for future reference when passed int data members. More...
 
void addGridCharDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid char data member code for future reference when passed char data members. More...
 
void addGridBoolDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid bool data member code for future reference when passed bool data members. More...
 
void addGridPackageFloatDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid package float data member code for future reference when passed float data members. More...
 
void addGridPackageIntDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid package int data member code for future reference when passed int data members. More...
 
void addGridPackageCharDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid package char data member code for future reference when passed char data members. More...
 
void addGridPackageBoolDataMemberCode (String sGridName, String sLabel, int iCode) throws SAXException
 Accepts a grid package bool data member code for future reference when passed bool data members. More...
 

Static Public Attributes

static final int RELATIVE_BASAL_AREA = 1
 Chart type is relative basal area. More...
 
static final int RELATIVE_DENSITY = 2
 Chart type is relative density. More...
 
static final int ABSOLUTE_BASAL_AREA = 3
 Chart type is absolute basal area. More...
 
static final int ABSOLUTE_DENSITY = 4
 Chart type is absolute density. More...
 
static final int ABSOLUTE_VOLUME = 5
 Chart type is absolute volume. More...
 
static final int RELATIVE_VOLUME = 6
 Chart type is relative volume. More...
 
static final int ABSOLUTE_BIOMASS = 7
 Chart type is absolute biomass. More...
 
static final int RELATIVE_BIOMASS = 8
 Chart type is relative biomass. More...
 

Protected Member Functions

void writeChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException, sortie.data.simpletypes.ModelException
 Writes the line graph's data to tab-delimited text. More...
 
DefaultXYDataset adjustVisibleSpecies (DefaultXYDataset oDataset, Legend oLegend) throws sortie.data.simpletypes.ModelException
 This will take a dataset and make a copy with only series for species which are supposed to be visible. More...
 
- Protected Member Functions inherited from sortie.datavisualizer.DataRequest
abstract void writeChartDataToFile (java.io.FileWriter jOut) throws java.io.IOException, ModelException
 Child classes override this to write the data behind their chart to tab-delimited text. More...
 

Private Member Functions

DefaultXYDataset makeDataset (DetailedOutputLegend oLegend) throws sortie.data.simpletypes.ModelException
 Creates the chart dataset. More...
 

Private Attributes

DefaultXYDataset m_oDataset = null
 The dataset with all species. More...
 
float [][] mp_fData
 Data array. More...
 
float [] mp_fTotal
 Data totals for absolute chart types. More...
 
int [] mp_iDataCode
 Holds the data codes for the data being graphed. More...
 
boolean [] mp_bWhichSpeciesShown
 A copy of which species are being displayed, so we know if the user changed it. More...
 
JCheckBox m_jUseTotals = null
 Checkbox for displaying the total. More...
 
float m_fPlotAreaInHectares
 Area of the plot, in hectares. More...
 
boolean m_bCurrentProcessing = false
 Whether or not the current processing was triggered by this object. More...
 
int m_iNumTimesteps = -1
 The total number of timesteps. More...
 
int m_iChartType
 The type of chart - absolute or relative / basal area or density. More...
 
int m_iTreeType
 Tree type of chart - seedling - snag. More...
 
int m_iDeadCode
 Dead code for trees (including NOTDEAD). More...
 

Additional Inherited Members

- Protected Attributes inherited from sortie.datavisualizer.DataRequest
String m_sBatchFilename = ""
 File name for batch data extraction. More...
 
int m_iCurrentTimestep
 Current time step being parsed. More...
 
boolean m_bShowOneTimestep = true
 Whether this chart shows one timestep at a time (true) or all timesteps (false). More...
 
boolean m_bExternallyManageWriting = true
 Whether or not this data request gets its file writing managed externally. More...
 
ModelInternalFrame m_oChartFrame
 Chart for this request. More...
 
String m_sChartName
 Name string of chart. More...
 

Detailed Description

Creates different types of line graphs for detailed output files.

It can produce absolute and relative graphs of density, basal area, biomass, or volume for saplings, adults, and snags; and absolute and relative graphs of density alone for seedlings.

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

Author
Lora E. Murphy
Version
1.1


Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)

Constructor & Destructor Documentation

◆ LineGraphDataRequest()

sortie.datavisualizer.LineGraphDataRequest.LineGraphDataRequest ( DetailedOutputFileManager  oManager,
String  sChartName,
int  iChartType,
int  iTreeType,
int  iDeadCode 
)

Constructor.

Declares all the arrays.

Parameters
oManagerParent detailed output file manager
sChartNameName of the table being drawn.
iChartTypeType of graph, absolute or relative / density or basal area.
iTreeTypeType of tree for which to draw this chart.
iDeadCodeDead code for trees (including NOTDEAD).

Member Function Documentation

◆ actionPerformed()

void sortie.datavisualizer.LineGraphDataRequest.actionPerformed ( java.awt.event.ActionEvent  oEvent)

Performs actions for the controls in the Histogram window.

Parameters
oEventEvent triggered.

◆ addDeadTreeFloatData()

void sortie.datavisualizer.LineGraphDataRequest.addDeadTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
int  iDeadCode,
float  fVal,
boolean  bBatchMode 
)

Accepts a tree float data member value.

If it matches our code, we'll increment either the count or the total, depending on the chart type.

Parameters
iSpeciesSpecies of the tree from which this value came.
iTypeType of the tree from which this value came.
iCodeData member code of this value.
iDeadCodeDead code for this value.
fValValue.
bBatchModeWhether not this is in the context of the batch utility.

◆ addTreeFloatData()

void sortie.datavisualizer.LineGraphDataRequest.addTreeFloatData ( int  iSpecies,
int  iType,
int  iCode,
float  fVal,
boolean  bBatchMode 
)

Accepts a tree float data member value.

If it matches our code, we'll increment either the count or the total, depending on the chart type.

Parameters
iSpeciesSpecies of the tree from which this value came.
iTypeType of the tree from which this value came.
iCodeData member code of this value.
fValValue.
bBatchModeWhether not this is in the context of the batch utility.

◆ addTreeFloatDataMemberCode()

void sortie.datavisualizer.LineGraphDataRequest.addTreeFloatDataMemberCode ( int  iSpecies,
int  iType,
String  sLabel,
int  iCode 
)

Accepts a tree float data member code.

Parameters
iSpeciesThe species for which this is a data member.
iTypeThe tree type for which this is a data member.
sLabelThe label of the data member.
iCodeThe data member code.

◆ adjustVisibleSpecies()

DefaultXYDataset sortie.datavisualizer.LineGraphDataRequest.adjustVisibleSpecies ( DefaultXYDataset  oDataset,
Legend  oLegend 
) throws sortie.data.simpletypes.ModelException
protected

This will take a dataset and make a copy with only series for species which are supposed to be visible.

Parameters
oDatasetThe dataset.
oLegendThe legend which controls which species are visible.
Returns
The dataset copy.
Exceptions
ModelExceptionwrapping another exception.

◆ makeDataset()

DefaultXYDataset sortie.datavisualizer.LineGraphDataRequest.makeDataset ( DetailedOutputLegend  oLegend) throws sortie.data.simpletypes.ModelException
private

Creates the chart dataset.

Parameters
oLegendLegend The legend for this chart.
Returns
DefaultCategoryDataset The dataset for the chart, NOT adjusted for which species are visible in the legend.
Exceptions
ModelExceptionif there is a problem creating the dataset.

◆ outputFileParseFinished()

void sortie.datavisualizer.LineGraphDataRequest.outputFileParseFinished ( boolean  bBatchMode)

This will be called for all open data requests after output file parsing is completed.

Parameters
bBatchModeWhether or not this is in the context of batch extraction mode.

◆ wantAnyDeadTreeFloats()

boolean sortie.datavisualizer.LineGraphDataRequest.wantAnyDeadTreeFloats ( )

This wants diameter values for all trees.

Returns
boolean Set to true.

◆ wantAnyTreeFloats()

boolean sortie.datavisualizer.LineGraphDataRequest.wantAnyTreeFloats ( )

This wants diameter values for all trees.

Returns
boolean Set to true.

◆ writeChartDataToFile()

void sortie.datavisualizer.LineGraphDataRequest.writeChartDataToFile ( java.io.FileWriter  jOut) throws java.io. IOException, sortie.data.simpletypes.ModelException
protected

Writes the line graph's data to tab-delimited text.

Parameters
jOutjava.io.FileWriter The file to write to.
Exceptions
java.io.IOExceptionif there is a problem writing the file.
ModelExceptionpassed through from called methods if the dataset doesn't make sense.

Member Data Documentation

◆ ABSOLUTE_BASAL_AREA

final int sortie.datavisualizer.LineGraphDataRequest.ABSOLUTE_BASAL_AREA = 3
static

Chart type is absolute basal area.

◆ ABSOLUTE_BIOMASS

final int sortie.datavisualizer.LineGraphDataRequest.ABSOLUTE_BIOMASS = 7
static

Chart type is absolute biomass.

◆ ABSOLUTE_DENSITY

final int sortie.datavisualizer.LineGraphDataRequest.ABSOLUTE_DENSITY = 4
static

Chart type is absolute density.

◆ ABSOLUTE_VOLUME

final int sortie.datavisualizer.LineGraphDataRequest.ABSOLUTE_VOLUME = 5
static

Chart type is absolute volume.

◆ m_bCurrentProcessing

boolean sortie.datavisualizer.LineGraphDataRequest.m_bCurrentProcessing = false
private

Whether or not the current processing was triggered by this object.

This lets this class know when to ignore offered data - whenever this value is set to false, some other chart event triggered the parse.

◆ m_fPlotAreaInHectares

float sortie.datavisualizer.LineGraphDataRequest.m_fPlotAreaInHectares
private

Area of the plot, in hectares.

◆ m_iChartType

int sortie.datavisualizer.LineGraphDataRequest.m_iChartType
private

The type of chart - absolute or relative / basal area or density.

◆ m_iDeadCode

int sortie.datavisualizer.LineGraphDataRequest.m_iDeadCode
private

Dead code for trees (including NOTDEAD).

◆ m_iNumTimesteps

int sortie.datavisualizer.LineGraphDataRequest.m_iNumTimesteps = -1
private

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.

◆ m_iTreeType

int sortie.datavisualizer.LineGraphDataRequest.m_iTreeType
private

Tree type of chart - seedling - snag.

◆ m_jUseTotals

JCheckBox sortie.datavisualizer.LineGraphDataRequest.m_jUseTotals = null
private

Checkbox for displaying the total.

Might be null if not needed.

◆ m_oDataset

DefaultXYDataset sortie.datavisualizer.LineGraphDataRequest.m_oDataset = null
private

The dataset with all species.

◆ mp_bWhichSpeciesShown

boolean [] sortie.datavisualizer.LineGraphDataRequest.mp_bWhichSpeciesShown
private

A copy of which species are being displayed, so we know if the user changed it.

◆ mp_fData

float [][] sortie.datavisualizer.LineGraphDataRequest.mp_fData
private

Data array.

Array indexes are #1 - species, and #2 - timestep.

◆ mp_fTotal

float [] sortie.datavisualizer.LineGraphDataRequest.mp_fTotal
private

Data totals for absolute chart types.

Array index is number of timestep.

◆ mp_iDataCode

int [] sortie.datavisualizer.LineGraphDataRequest.mp_iDataCode
private

Holds the data codes for the data being graphed.

For density for seedlings, this is diam10; for density or basal area, it's DBH; for volume, it's volume. Array index is # of species.

◆ RELATIVE_BASAL_AREA

final int sortie.datavisualizer.LineGraphDataRequest.RELATIVE_BASAL_AREA = 1
static

Chart type is relative basal area.

◆ RELATIVE_BIOMASS

final int sortie.datavisualizer.LineGraphDataRequest.RELATIVE_BIOMASS = 8
static

Chart type is relative biomass.

◆ RELATIVE_DENSITY

final int sortie.datavisualizer.LineGraphDataRequest.RELATIVE_DENSITY = 2
static

Chart type is relative density.

◆ RELATIVE_VOLUME

final int sortie.datavisualizer.LineGraphDataRequest.RELATIVE_VOLUME = 6
static

Chart type is relative volume.


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