datavisualizer.ShortOutputFileManager Class Reference

Manages all the data visualization for a single short output file. More...

Inheritance diagram for datavisualizer.ShortOutputFileManager:

datavisualizer.DataFileManager

List of all members.

Public Member Functions

void UpdateCurrentRunCharts () throws ModelException
 Updates charts for a current run.
void UpdateCharts () throws ModelException
 Redraws all open chart objects, except tables.
String[] GetTableOptions ()
 Gets table options.
String[] GetHistogramOptions ()
 No histogram options for this type of chart.
String[] GetMapOptions ()
 No map options for this type of chart.
String[] GetLineGraphOptions ()
 Gets the line graph options.
 ShortOutputFileManager (String sFileName) throws ModelException
 Constructor.

Protected Member Functions

JInternalFrame DrawChart (String sGraphName) throws ModelException
 Draws a requested chart.
void UpdateTable (JPanel jTableWindowPanel, int iTimestep, int iSubplot)
 Updates a table window with new data.
DefaultXYDataset AdjustVisibleSpecies (DefaultXYDataset oDataset, Legend oLegend) throws ModelException
 This will take a dataset and make a copy with only series for species which are supposed to be visible.

Private Member Functions

Object[][][] CreateTableDataset (int iTimestep, int iSubplot)
 Creates the datasets for the overview table.
JInternalFrame CreateTable (int iTimestep, int iSubplot, Legend oLegend, String sChartTitle) throws ModelException
 Creates the table.
void ParseFile () throws ModelException
 Reads the file data into the internal arrays.
DefaultXYDataset CreateDataset (Float[][] p_fDataToGraph, Float[] p_fTotals)
 Translates data into the CategoryDataset format, which can then be fed to a chart for display.

Private Attributes

Vector< ModelDatasetmp_oDatasets = new Vector<ModelDataset>(0)
 Datasets for each chart.
Float[][][][] mp_fRBA
 Relative basal area data.
Float[][][][] mp_fABA
 Absolute basal area data.
Float[][][][] mp_fRDN
 Relative density data.
Float[][][][] mp_fADN
 Absolute density data.
Float[][][] mp_fABT
 Absolute basal area totals.
Float[][][] mp_fADT
 Absolute density totals.
String[] mp_sSpeciesNames
 List of species names.
String[] mp_sSubplotNames = null
 List of subplot names.
String m_sFileDisplayName
 Display string of filename - should have the last 20 chars.
int m_iNumTypes = 4
 Number of tree types that this object is willing to work with.
int m_iNumSubplots = 1
 Number of subplots in this file.
int m_iNumSpecies = 0
 Number of species in the file.
int m_iNumTimesteps = 0
 Number of timesteps in the file.

Static Private Attributes

static final int SEEDLING = 0
 Seedling.
static final int SAPLING = 1
 Sapling.
static final int ADULT = 2
 Adult.
static final int SNAG = 3
 Snag.
static final int RELATIVE_BASAL_AREA = 4
 Relative basal area chart type.
static final int RELATIVE_DENSITY = 5
 Relative density chart type.
static final int ABSOLUTE_BASAL_AREA = 6
 Absolute basal area chart type.
static final int ABSOLUTE_DENSITY = 7
 Absolute density chart type.

Classes

class  LineGraphFileWriter
 Takes care of writing out a line graph's data. More...
class  TableFileWriter
 Writes out table data to file. More...
class  TotalUpdater
 Handles it when a "Show Total" checkbox is checked. More...


Detailed Description

Manages all the data visualization for a single short output file.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
July 15, 2004: Added subplot support (LEM)
July 27, 2004: Added table (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Constructor & Destructor Documentation

datavisualizer.ShortOutputFileManager.ShortOutputFileManager ( String  sFileName  )  throws ModelException

Constructor.

Analyzes the output file for the data it contains.

Parameters:
sFileName Filename to manage.
Exceptions:
ModelException If file cannot be read.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
June 25, 2004: Added snag support (LEM)
July 15, 2004: Added subplot support (LEM)


Member Function Documentation

JInternalFrame datavisualizer.ShortOutputFileManager.DrawChart ( String  sGraphName  )  throws ModelException [protected, virtual]

Draws a requested chart.

Parameters:
sGraphName Name of the chart to draw.
Returns:
Chart, or NULL if it could not be drawn.
Exceptions:
ModelException if there's a problem drawing the chart.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
June 25, 2004: Added snag support (LEM)
July 15, 2004: Added subplot support (LEM)
July 27, 2004: Added the table (LEM)

Implements datavisualizer.DataFileManager.

Object [][][] datavisualizer.ShortOutputFileManager.CreateTableDataset ( int  iTimestep,
int  iSubplot 
) [private]

Creates the datasets for the overview table.

This creates four table datasets, one each for seedlings, saplings, adults, and snags. All numbers are placed in as formatted strings with a max of 2 decimal places.

Parameters:
iTimestep Timestep for which to draw the table.
iSubplot Index of subplot, or 0 if it's the whole plot.
Returns:
Array of datasets for tables, ready to pass to DataGrapher. Index 0 is the seedling dataset, 1 is the sapling dataset, 2 is the adult dataset, and 3 is the snag dataset.

JInternalFrame datavisualizer.ShortOutputFileManager.CreateTable ( int  iTimestep,
int  iSubplot,
Legend  oLegend,
String  sChartTitle 
) throws ModelException [private]

Creates the table.

There are four sub-tables, one each for seedlings, saplings, adults, and snags. The tables are arranged in two rows, with adults and saplings in the top row and snags and seedlings in the bottom row.

A pair of buttons is added to advance the table forward and back.

Parameters:
oLegend Legend for this table.
iTimestep Timestep for which to draw the table.
iSubplot Index of subplot, or 0 if it's the whole plot.
sChartTitle Title to display in the chart window.
Returns:
Panel containing the table.
Exceptions:
ModelException If anything goes wrong with the drawing.

Edit history:
------------------
July 27, 2004: Created (LEM)
February 28, 2007: Added controls for jumping to a timestep (LEM)

void datavisualizer.ShortOutputFileManager.UpdateTable ( JPanel  jTableWindowPanel,
int  iTimestep,
int  iSubplot 
) [protected]

Updates a table window with new data.

Parameters:
jTableWindowPanel The content pane of the window containing the table to update.
iTimestep The timestep of the data to display.
iSubplot The subplot of the data to display.

void datavisualizer.ShortOutputFileManager.UpdateCurrentRunCharts (  )  throws ModelException [virtual]

Updates charts for a current run.

This reparses and redraws the charts from scratch, since they show the cumulative history of a run.

Exceptions:
ModelException if there is a problem reading the file or drawing the charts.

Edit history:
------------------
November 18, 2004: Created (LEM)
December 20, 2006: Added checkbox control for totals (LEM)

Implements datavisualizer.DataFileManager.

void datavisualizer.ShortOutputFileManager.UpdateCharts (  )  throws ModelException [virtual]

Redraws all open chart objects, except tables.

Tables are not affected by any incidence that affects the other charts, such as clicking species on the legend.

Exceptions:
ModelException passing through from other methods.

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

Implements datavisualizer.DataFileManager.

String [] datavisualizer.ShortOutputFileManager.GetTableOptions (  )  [virtual]

Gets table options.

A summary table can be created from this file type.

Returns:
List of table options

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

Implements datavisualizer.DataFileManager.

String [] datavisualizer.ShortOutputFileManager.GetHistogramOptions (  )  [virtual]

No histogram options for this type of chart.

Returns:
null

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

Implements datavisualizer.DataFileManager.

String [] datavisualizer.ShortOutputFileManager.GetMapOptions (  )  [virtual]

No map options for this type of chart.

Returns:
null.

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

Implements datavisualizer.DataFileManager.

String [] datavisualizer.ShortOutputFileManager.GetLineGraphOptions (  )  [virtual]

Gets the line graph options.

Returns:
List of line graphs.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)]
June 25, 2004: Added snags (LEM)
July 15, 2004: Added subplots (LEM)

Implements datavisualizer.DataFileManager.

void datavisualizer.ShortOutputFileManager.ParseFile (  )  throws ModelException [private]

Reads the file data into the internal arrays.

Exceptions:
ModelException if the file cannot be opened or read.

Edit history:
------------------
June 29, 2005: Put the relative values as percentages (LEM)

DefaultXYDataset datavisualizer.ShortOutputFileManager.CreateDataset ( Float  p_fDataToGraph[][],
Float[]  p_fTotals 
) [private]

Translates data into the CategoryDataset format, which can then be fed to a chart for display.

Parameters:
p_fDataToGraph The data to graph as a 2D Float array, with the first index being number of species and the second number of timesteps.
p_fTotals The totals array, sized number of timesteps, if applicable; if there are no totals, pass null.
Returns:
The oDataset.

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

DefaultXYDataset datavisualizer.ShortOutputFileManager.AdjustVisibleSpecies ( DefaultXYDataset  oDataset,
Legend  oLegend 
) throws 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.


Member Data Documentation

final int datavisualizer.ShortOutputFileManager.SEEDLING = 0 [static, private]

Seedling.

final int datavisualizer.ShortOutputFileManager.SAPLING = 1 [static, private]

Sapling.

final int datavisualizer.ShortOutputFileManager.ADULT = 2 [static, private]

Adult.

final int datavisualizer.ShortOutputFileManager.SNAG = 3 [static, private]

Snag.

Relative basal area chart type.

Relative density chart type.

Absolute basal area chart type.

Absolute density chart type.

Datasets for each chart.

Relative basal area data.

Array indexes are #1 - subplot, #2 - type, #3 - species, and #4 - timestep.

Absolute basal area data.

Array indexes are #1 - subplot, #2 - type, #3 - species, and #4 - timestep.

Relative density data.

Array indexes are #1 - subplot, #2 - type, #3 - species, and #4 - timestep.

Absolute density data.

Array indexes are #1 - subplot, #2 - type, #3 - species, and #4 - timestep.

Absolute basal area totals.

Array indexes are #1 - subplot, #2 - type, and #3 - timestep.

Absolute density totals.

Array indexes are #1 - subplot, #2 - type, and #3 - timestep.

List of species names.

List of subplot names.

Display string of filename - should have the last 20 chars.

Number of tree types that this object is willing to work with.

Number of subplots in this file.

Number of species in the file.

Number of timesteps in the file.


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