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

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

Inheritance diagram for sortie.datavisualizer.ShortOutputFileManager:
sortie.datavisualizer.DataFileManager

Classes

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

Public Member Functions

void updateCurrentRunCharts () throws ModelException
 Updates charts for a current run. More...
 
void updateCharts () throws ModelException
 Redraws all open chart objects, except tables. More...
 
JPopupMenu getTableOptions (ActionListener sActionListener)
 Gets table options. More...
 
JPopupMenu getLineGraphOptions (ActionListener sActionListener)
 Gets the line graph options. More...
 
 ShortOutputFileManager (DataVisualizerManager oManager, String sFileName) throws ModelException
 Constructor. More...
 
JPopupMenu getHistogramOptions (ActionListener actionListener)
 No histogram options for this type of chart. More...
 
JPopupMenu getMapOptions (ActionListener actionListener)
 No map options for this type of chart. More...
 
- Public Member Functions inherited from sortie.datavisualizer.DataFileManager
Legend getLegend ()
 Get the legend for this file. More...
 
int getNumberOpenCharts ()
 Gets the number of open charts for this file. More...
 
void closeAllCharts ()
 Closes all the open charts for this window. More...
 
void cleanUp () throws ModelException
 Any clean-up tasks that must be done can be put here. More...
 
 DataFileManager (DataVisualizerManager oManager, String sFileName)
 Constructor. More...
 
String getFileName ()
 Gets the file being managed. More...
 
abstract JPopupMenu getLineGraphOptions (ActionListener sActionListener)
 Gets a list of the line graphs this object is capable of drawing. More...
 
abstract JPopupMenu getMapOptions (ActionListener sActionListener)
 Gets a list of maps this object is capable of drawing. More...
 
abstract JPopupMenu getHistogramOptions (ActionListener sActionListener)
 Gets a list of histograms this object is capable of drawing. More...
 
abstract JPopupMenu getTableOptions (ActionListener sActionListener)
 Gets a list of tables this object is capable of drawing. More...
 
JInternalFrame createNewChart (String sGraphName) throws ModelException
 Creates a requested chart as a JInternalFrame. More...
 
abstract void updateCharts () throws ModelException
 Prompts the redrawing of all open charts. More...
 
abstract void updateCurrentRunCharts () throws ModelException
 Prompts the redrawing of open charts for the current run. More...
 

Protected Member Functions

JInternalFrame drawChart (String sGraphName) throws ModelException
 Draws a requested chart. More...
 
void updateTable (JPanel jTableWindowPanel, int iTimestep, int iSubplot, int iDead)
 Updates a table window with new data. More...
 
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. More...
 
- Protected Member Functions inherited from sortie.datavisualizer.DataFileManager
abstract JInternalFrame drawChart (String sGraphName) throws ModelException
 Creates a requested chart as a JInternalFrame. More...
 

Private Member Functions

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

Private Attributes

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

Static Private Attributes

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

Additional Inherited Members

- Protected Attributes inherited from sortie.datavisualizer.DataFileManager
DataVisualizerManager m_oManager
 Manager object. More...
 
String m_sFilename
 File under management. More...
 
ArrayList< JInternalFrame > mp_oCharts = new ArrayList<JInternalFrame>(0)
 All charts under management. More...
 
Legend m_oLegend
 The legend for this file. More...
 
String [] mp_sDeadCodeNames = new String[OutputBehaviors.NUMCODES]
 Text equivalents of dead codes. More...
 

Detailed Description

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

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

Author
Lora E. Murphy
Version
1.0


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

Constructor & Destructor Documentation

◆ ShortOutputFileManager()

sortie.datavisualizer.ShortOutputFileManager.ShortOutputFileManager ( DataVisualizerManager  oManager,
String  sFileName 
) throws ModelException

Constructor.

Analyzes the output file for the data it contains.

Parameters
oManagerManager managing this object.
sFileNameFilename to manage.
Exceptions
ModelExceptionIf file cannot be read.

Member Function Documentation

◆ adjustVisibleSpecies()

DefaultXYDataset sortie.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
oDatasetThe dataset.
oLegendThe legend which controls which species are visible.
Returns
The dataset copy.
Exceptions
ModelExceptionwrapping another exception.

◆ createDataset()

DefaultXYDataset sortie.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_fDataToGraphThe data to graph as a 2D Float array, with the first index being number of species and the second number of timesteps.
p_fTotalsThe totals array, sized number of timesteps, if applicable; if there are no totals, pass null.
Returns
The oDataset.

◆ createTable()

JInternalFrame sortie.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
oLegendLegend for this table.
iTimestepTimestep for which to draw the table.
iSubplotIndex of subplot, or 0 if it's the whole plot.
sChartTitleTitle to display in the chart window.
Returns
Panel containing the table.
Exceptions
ModelExceptionIf anything goes wrong with the drawing.

◆ createTableDataset()

Object [][][] sortie.datavisualizer.ShortOutputFileManager.createTableDataset ( int  iTimestep,
int  iSubplot,
int  iDead 
)
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
iTimestepTimestep for which to draw the table.
iSubplotIndex of subplot, or 0 if it's the whole plot.
iDeadDead code of table to update.
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.

◆ drawChart()

JInternalFrame sortie.datavisualizer.ShortOutputFileManager.drawChart ( String  sGraphName) throws ModelException
protected

Draws a requested chart.

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

◆ getHistogramOptions()

JPopupMenu sortie.datavisualizer.ShortOutputFileManager.getHistogramOptions ( ActionListener  actionListener)

No histogram options for this type of chart.

Returns
null

◆ getLineGraphOptions()

JPopupMenu sortie.datavisualizer.ShortOutputFileManager.getLineGraphOptions ( ActionListener  sActionListener)

Gets the line graph options.

Parameters
sActionListenerAction listener that will respond to menu events
Returns
List of line graphs.

◆ getMapOptions()

JPopupMenu sortie.datavisualizer.ShortOutputFileManager.getMapOptions ( ActionListener  actionListener)

No map options for this type of chart.

Returns
null.

◆ getTableOptions()

JPopupMenu sortie.datavisualizer.ShortOutputFileManager.getTableOptions ( ActionListener  sActionListener)

Gets table options.

A summary table can be created from this file type.

Parameters
sActionListenerAction listener that will respond to menu events
Returns
List of table options

◆ parseFile()

void sortie.datavisualizer.ShortOutputFileManager.parseFile ( ) throws ModelException
private

Reads the file data into the internal arrays.

Exceptions
ModelExceptionif the file cannot be opened or read.

◆ updateCharts()

void sortie.datavisualizer.ShortOutputFileManager.updateCharts ( ) throws ModelException

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
ModelExceptionpassing through from other methods.

◆ updateCurrentRunCharts()

void sortie.datavisualizer.ShortOutputFileManager.updateCurrentRunCharts ( ) throws ModelException

Updates charts for a current run.

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

Exceptions
ModelExceptionif there is a problem reading the file or drawing the charts.

◆ updateTable()

void sortie.datavisualizer.ShortOutputFileManager.updateTable ( JPanel  jTableWindowPanel,
int  iTimestep,
int  iSubplot,
int  iDead 
)
protected

Updates a table window with new data.

Parameters
jTableWindowPanelThe content pane of the window containing the table to update.
iTimestepThe timestep of the data to display.
iSubplotThe subplot of the data to display.
iDeadDead code of panel to update.

Member Data Documentation

◆ ABSOLUTE_BASAL_AREA

final int sortie.datavisualizer.ShortOutputFileManager.ABSOLUTE_BASAL_AREA = 6
staticprivate

Absolute basal area chart type.

◆ ABSOLUTE_DENSITY

final int sortie.datavisualizer.ShortOutputFileManager.ABSOLUTE_DENSITY = 7
staticprivate

Absolute density chart type.

◆ ADULT

final int sortie.datavisualizer.ShortOutputFileManager.ADULT = 2
staticprivate

Adult.

◆ m_iNumSpecies

int sortie.datavisualizer.ShortOutputFileManager.m_iNumSpecies = 0
private

Number of species in the file.

◆ m_iNumSubplots

int sortie.datavisualizer.ShortOutputFileManager.m_iNumSubplots = 1
private

Number of subplots in this file.

◆ m_iNumTimesteps

int sortie.datavisualizer.ShortOutputFileManager.m_iNumTimesteps = 0
private

Number of timesteps in the file.

◆ m_iNumTypes

int sortie.datavisualizer.ShortOutputFileManager.m_iNumTypes = 4
private

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

◆ m_sLongFileDisplayName

String sortie.datavisualizer.ShortOutputFileManager.m_sLongFileDisplayName
private

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

◆ m_sShortFileDisplayName

String sortie.datavisualizer.ShortOutputFileManager.m_sShortFileDisplayName
private

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

◆ mp_fABA

Float [][][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fABA
private

Absolute basal area data.

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

◆ mp_fABT

Float [][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fABT
private

Absolute basal area totals.

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

◆ mp_fADN

Float [][][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fADN
private

Absolute density data.

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

◆ mp_fADT

Float [][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fADT
private

Absolute density totals.

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

◆ mp_fRBA

Float [][][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fRBA
private

Relative basal area data.

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

◆ mp_fRDN

Float [][][][][] sortie.datavisualizer.ShortOutputFileManager.mp_fRDN
private

Relative density data.

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

◆ mp_oDatasets

ArrayList<ModelDataset> sortie.datavisualizer.ShortOutputFileManager.mp_oDatasets = new ArrayList<ModelDataset>(0)
private

Datasets for each chart.

◆ mp_sSpeciesNames

String [] sortie.datavisualizer.ShortOutputFileManager.mp_sSpeciesNames
private

List of species names.

◆ mp_sSubplotNames

String [] sortie.datavisualizer.ShortOutputFileManager.mp_sSubplotNames = null
private

List of subplot names.

◆ RELATIVE_BASAL_AREA

final int sortie.datavisualizer.ShortOutputFileManager.RELATIVE_BASAL_AREA = 4
staticprivate

Relative basal area chart type.

◆ RELATIVE_DENSITY

final int sortie.datavisualizer.ShortOutputFileManager.RELATIVE_DENSITY = 5
staticprivate

Relative density chart type.

◆ SAPLING

final int sortie.datavisualizer.ShortOutputFileManager.SAPLING = 1
staticprivate

Sapling.

◆ SEEDLING

final int sortie.datavisualizer.ShortOutputFileManager.SEEDLING = 0
staticprivate

Seedling.

◆ SNAG

final int sortie.datavisualizer.ShortOutputFileManager.SNAG = 3
staticprivate

Snag.


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