datavisualizer.GridAllSpeciesHistogramDataRequest Class Reference

This controls the drawing of a histogram for all species at once for a grid for those grids that display values by species. More...

Inheritance diagram for datavisualizer.GridAllSpeciesHistogramDataRequest:

datavisualizer.DataRequest

List of all members.

Public Member Functions

 GridAllSpeciesHistogramDataRequest (String sLabel, boolean bIsFloat, DetailedOutputFileManager oManager, String sGraphName, String sGridName)
 Constructor.
void actionPerformed (ActionEvent oEvent)
 Performs actions for the controls in the Histogram window.
float GetBinSize ()
 Gets the bin size for this data request's histogram.
boolean GetUseLogarithmicAxis ()
 Gets whether or not to use a logarithmic axis.
void AddGridFloatDataMemberCode (String sGridName, String sLabel, int iCode)
 Captures the data member code if we're graphing a float.
void AddGridIntDataMemberCode (String sGridName, String sLabel, int iCode)
 Captures the data member code if we're graphing an integer.
void AddGridIntData (String sGridName, int iX, int iY, int iCode, int iVal)
 This will add the integer data, if the data for this chart is an int that matches the data member code.
void AddGridFloatData (String sGridName, int iX, int iY, int iCode, float fVal)
 This will add the float data, if the data for this chart is a float that matches the data member code.
boolean WantAnyGridInts ()
 If our data piece that's being graphed is an integer, this returns true.
boolean WantAnyGridFloats ()
 If our data piece that's being graphed is a float, this returns true.

Protected Member Functions

void WriteChartDataToFile (java.io.FileWriter jOut) throws java.io. IOException
 Writes the histogram's data to tab-delimited text.
ModelHistogramDataset UpdateForVisible (Legend oLegend) throws ModelException
 Copies our dataset and includes only species marked as visible in the legend.
void AddSeriesToDataset () throws ModelException
 This will add all series to the dataset.

Protected Attributes

ModelHistogramDataset m_oDataset
 The dataset that will be graphed.

Package Functions

ModelInternalFrame DrawChart (Legend oLegend, String sChartTitle) throws ModelException
 Creates the histogram using data accumulated thus far.
void UpdateChart (Legend oLegend) throws ModelException
 Updates the histogram.
void ClearData ()
 This nulls our dataset and recreates it, and clears all of our data vectors.

Package Attributes

java.text.DecimalFormat m_jSmallNumsFormat
 Formatter for very small numbers.

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

String m_sLabel
 Label root of the piece of data, as it would be passed as a data member code, with "_[x]" appended (x = species number); so if the piece of data is named "seeds_x", one per species, then this is "seeds".
String m_sGridName
 Name of grid.
boolean m_bIsFloat
 Whether our data member being graphed is a float.
boolean m_bIsInt
 Whether our data member being graphed is an integer.
JTextField m_jNumBins = new JTextField("")
 Field displaying the number of bins in the histogram.
JTextField m_jBinSize = new JTextField("")
 Field displaying the bin size in the histogram.
int[] mp_iDataMemberCodes
 The data member codes for this data member - one per species.
ArrayList< ArrayList< Number > > mp_oData
 The data - kept in an array of vectors - one per species.
float m_fBinSize
 Size of the histogram bins.
int m_iNumBins
 Number of bins in the histogram.
boolean m_bUseLogarithmicAxis
 Whether or not to use a logarithmic axis on the Y.
boolean m_bRecalcBinsOnUpdate
 Whether or not we have to recalculate the bins on chart update (i.e.
boolean m_bShowTotal = true
 Whether or not to display a total bar in each bin.
java.text.NumberFormat m_jFormat = java.text.NumberFormat.getInstance()
 Formatter for big numbers.


Detailed Description

This controls the drawing of a histogram for all species at once for a grid for those grids that display values by species.

The label of the data is passed in the constructor. The histogram is defaulted to 10 divisions equally divided between their minimum and maximum values.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
October 20, 2010: Created (LEM)

Constructor & Destructor Documentation

datavisualizer.GridAllSpeciesHistogramDataRequest.GridAllSpeciesHistogramDataRequest ( String  sLabel,
boolean  bIsFloat,
DetailedOutputFileManager  oManager,
String  sGraphName,
String  sGridName 
)

Constructor.

Parameters:
sLabel Label root of the piece of data, as it would be passed as a data member code, with "_x" appended; so if the piece of data is named "seeds_x", one per species, then pass "seeds".
bIsFloat Whether this is float data. If this is set to false, integer data is assumed.
oManager The parent detailed output file manager.
sGraphName Name of graph string.
sGridName Name of grid.


Member Function Documentation

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

Writes the histogram'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.GridAllSpeciesHistogramDataRequest.actionPerformed ( ActionEvent  oEvent  ) 

Performs actions for the controls in the Histogram window.

Parameters:
oEvent Event triggered.

float datavisualizer.GridAllSpeciesHistogramDataRequest.GetBinSize (  ) 

Gets the bin size for this data request's histogram.

Returns:
The bin size.

boolean datavisualizer.GridAllSpeciesHistogramDataRequest.GetUseLogarithmicAxis (  ) 

Gets whether or not to use a logarithmic axis.

Returns:
True if a logarithmic axis should be used, or false if a linear axis should be used.

int datavisualizer.GridAllSpeciesHistogramDataRequest.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.

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

Captures the data member code if we're graphing a float.

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

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.GridAllSpeciesHistogramDataRequest.AddGridIntDataMemberCode ( String  sGridName,
String  sLabel,
int  iCode 
)

Captures the data member code if we're graphing an integer.

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

Reimplemented from datavisualizer.DataRequest.

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

Creates the histogram using data accumulated thus far.

Parameters:
oLegend Legend for this chart.
sChartTitle Title for this chart.
Returns:
The new chart window.
Exceptions:
datavisualizer.ModelException Passing through underlying exceptions.

Implements datavisualizer.DataRequest.

ModelHistogramDataset datavisualizer.GridAllSpeciesHistogramDataRequest.UpdateForVisible ( Legend  oLegend  )  throws ModelException [protected]

Copies our dataset and includes only species marked as visible in the legend.

Parameters:
oLegend Legend for this chart.
Returns:
The copied dataset.
Exceptions:
ModelException Passing through an underlying exception.

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

Updates the histogram.

Parameters:
oLegend Legend for this chart.
Exceptions:
datavisualizer.ModelException Passing through an underlying exception.

Implements datavisualizer.DataRequest.

void datavisualizer.GridAllSpeciesHistogramDataRequest.AddSeriesToDataset (  )  throws ModelException [protected]

This will add all series to the dataset.

Exceptions:
ModelException Passing through from underlying

void datavisualizer.GridAllSpeciesHistogramDataRequest.AddGridIntData ( String  sGridName,
int  iX,
int  iY,
int  iCode,
int  iVal 
)

This will add the integer data, if the data for this chart is an int that matches the data member code.

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.
iVal Value.

Reimplemented from datavisualizer.DataRequest.

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

This will add the float data, if the data for this chart is a float that matches the data member code.

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.
iVal Value.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.GridAllSpeciesHistogramDataRequest.WantAnyGridInts (  ) 

If our data piece that's being graphed is an integer, this returns true.

Otherwise, false.

Returns:
Whether this object's data piece is an integer.

Reimplemented from datavisualizer.DataRequest.

boolean datavisualizer.GridAllSpeciesHistogramDataRequest.WantAnyGridFloats (  ) 

If our data piece that's being graphed is a float, this returns true.

Otherwise, false.

Returns:
Whether this object's data piece is a float.

Reimplemented from datavisualizer.DataRequest.

void datavisualizer.GridAllSpeciesHistogramDataRequest.ClearData (  )  [package, virtual]

This nulls our dataset and recreates it, and clears all of our data vectors.

Implements datavisualizer.DataRequest.


Member Data Documentation

Label root of the piece of data, as it would be passed as a data member code, with "_[x]" appended (x = species number); so if the piece of data is named "seeds_x", one per species, then this is "seeds".

Name of grid.

Whether our data member being graphed is a float.

Whether our data member being graphed is an integer.

The dataset that will be graphed.

JTextField datavisualizer.GridAllSpeciesHistogramDataRequest.m_jNumBins = new JTextField("") [private]

Field displaying the number of bins in the histogram.

JTextField datavisualizer.GridAllSpeciesHistogramDataRequest.m_jBinSize = new JTextField("") [private]

Field displaying the bin size in the histogram.

The data member codes for this data member - one per species.

ArrayList<ArrayList<Number> > datavisualizer.GridAllSpeciesHistogramDataRequest.mp_oData [private]

The data - kept in an array of vectors - one per species.

Size of the histogram bins.

Number of bins in the histogram.

Whether or not to use a logarithmic axis on the Y.

Whether or not we have to recalculate the bins on chart update (i.e.

we are charting an unknown data type without defaults)

Whether or not to display a total bar in each bin.

java.text.NumberFormat datavisualizer.GridAllSpeciesHistogramDataRequest.m_jFormat = java.text.NumberFormat.getInstance() [private]

Formatter for big numbers.

Initial value:

 new java.text.DecimalFormat(
        "0.#E0")
Formatter for very small numbers.


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

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