datavisualizer.FoliarChemistryLineGraphDataRequest Class Reference

Produces a line graph of foliar chemistry results (one component - i.e. More...

Inheritance diagram for datavisualizer.FoliarChemistryLineGraphDataRequest:

datavisualizer.DataRequest

List of all members.

Public Member Functions

 FoliarChemistryLineGraphDataRequest (String sChartName, DetailedOutputFileManager oManager) throws ModelException
 Constructor.
void AddGridFloatData (String sGridName, int iX, int iY, int iCode, float fVal)
 This accepts float data.
boolean WantAnyGridFloats ()
 This wants floats.
void AddGridFloatDataMemberCode (String sGridName, String sLabel, int iCode)
 Accepts a grid float data member code for future reference when passed float data members.
void actionPerformed (java.awt.event.ActionEvent oEvent)
 Performs actions for the controls in the line graph window.

Protected Member Functions

void WriteChartDataToFile (FileWriter jOut) throws IOException, javawrapper.ModelException
 Writes the line graph's data to tab-delimited text.
DefaultXYDataset AdjustVisibleSpecies (DefaultXYDataset oDataset, Legend oLegend) throws javawrapper.ModelException
 This will take a dataset and make a copy with only series for species which are supposed to be visible.

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 javawrapper.ModelException
 This will update the chart only if the user has changed which species are visible or unless the number of timesteps is different.
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.
DefaultXYDataset MakeDataset (DetailedOutputLegend oLegend) throws javawrapper.ModelException
 Creates the chart dataset.

Private Attributes

float[][] mp_fDatasetValues = null
 The dataset values.
DefaultXYDataset m_oDataset = null
 The dataset with all species - keep this for quicker updating when visible species are changed.
int[] mp_iIndexes
 Translates a data member code to an index for the piece of data being graphed.
boolean[] mp_bWhichSpeciesShown
 A copy of which species are being displayed, so we know if the user changed it.
JCheckBox m_jUseTotals = null
 Checkbox for displaying the total.
String m_sDataMember
 Data member name for the piece of data being graphed.
String m_sDataMemberDisplay
 Data member name for displaying on chart.
String[] mp_sSpeciesNames
 Array of species names for display.
String m_sThisGrid
 Name of the grid from which the data will be collected.
float m_fPlotAreaInHa
 Plot area, in hectares.
int m_iNumSpecies
 The number of species.
int m_iCurrentTimestep = -1
 The current timestep.
int m_iNumTimesteps = -1
 The total number of timesteps.


Detailed Description

Produces a line graph of foliar chemistry results (one component - i.e.

N, P, etc) for all species. This requires the detailed output file to have data saved from the "Foliar Chemistry" grid.

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

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
December 11, 2008: Created (LEM)

Constructor & Destructor Documentation

datavisualizer.FoliarChemistryLineGraphDataRequest.FoliarChemistryLineGraphDataRequest ( 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.


Member Function Documentation

void datavisualizer.FoliarChemistryLineGraphDataRequest.WriteChartDataToFile ( FileWriter  jOut  )  throws IOException, javawrapper.ModelException [protected]

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

Parameters:
jOut The file to write to.
Exceptions:
IOException if there is a problem writing the file.
ModelException passed through from called methods if the dataset doesn't make sense.

void datavisualizer.FoliarChemistryLineGraphDataRequest.AddGridFloatData ( String  sGridName,
int  iX,
int  iY,
int  iCode,
float  fVal 
)

This accepts float data.

The index vector is consulted and the values added to the appropriate array 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.FoliarChemistryLineGraphDataRequest.WantAnyGridFloats (  ) 

This wants floats.

Returns:
True.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.FoliarChemistryLineGraphDataRequest.AddGridFloatDataMemberCode ( String  sGridName,
String  sLabel,
int  iCode 
)

Accepts a grid 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.FoliarChemistryLineGraphDataRequest.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.FoliarChemistryLineGraphDataRequest.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 

Implements datavisualizer.DataRequest.

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

This will update the chart only if the user has changed which species are visible or unless the number of timesteps is different.

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

Implements datavisualizer.DataRequest.

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

Clears out existing data.

Exceptions:
ModelException Doesn't throw an exception.

Implements datavisualizer.DataRequest.

DefaultXYDataset datavisualizer.FoliarChemistryLineGraphDataRequest.MakeDataset ( DetailedOutputLegend  oLegend  )  throws javawrapper.ModelException [private]

Creates the chart dataset.

Parameters:
oLegend Legend The legend for this chart.
Returns:
DefaultCategoryDataset The dataset for the chart, NOT adjusted for which species are visible in the legend.
Exceptions:
ModelException if there is a problem creating the dataset.

DefaultXYDataset datavisualizer.FoliarChemistryLineGraphDataRequest.AdjustVisibleSpecies ( DefaultXYDataset  oDataset,
Legend  oLegend 
) throws javawrapper.ModelException [protected]

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

Parameters:
oDataset The dataset.
oLegend The legend which controls which species are visible.
Returns:
The dataset copy.
Exceptions:
ModelException wrapping another exception.

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

Performs actions for the controls in the line graph window.

Parameters:
oEvent Event triggered.

Reimplemented from datavisualizer.DataRequest.


Member Data Documentation

The dataset values.

The first index is number of species plus one extra for all the species. The second index is number of timesteps.

The dataset with all species - keep this for quicker updating when visible species are changed.

Translates a data member code to an index for the piece of data being graphed.

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

Checkbox for displaying the total.

Might be null if not needed.

Data member name for the piece of data being graphed.

Data member name for displaying on chart.

Array of species names for display.

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

Plot area, in hectares.

The number of species.

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.

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.


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

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