datavisualizer::DataGrapher Class Reference

Objects of this class can create graphs of various kinds, given data. More...

List of all members.

Static Public Member Functions

static void UpdateLineChart (DefaultXYDataset oDataset, JInternalFrame jFrame, Legend oLegend, JCheckBox jUseTotals, int iNumSpecies) throws ModelException
 Updates a line chart in a window with a fresh dataset.
static void UpdateHistogram (ModelHistogramDataset oDataset, JInternalFrame jFrame, Legend oLegend, HistogramDataRequest oRequest) throws ModelException
 Updates a histogram with a fresh dataset.
static void UpdateHistogram (ModelHistogramDataset oDataset, JInternalFrame jFrame, Legend oLegend, GridHistogramDataRequest oRequest) throws ModelException
 Updates a histogram with a fresh dataset.
static void UpdateTreeMap (XYZDataset oDataset, JInternalFrame jFrame, Legend oLegend, float fDbhScaleFactor, float fMinDbh) throws ModelException
 Updates a tree map with a fresh dataset.
static void UpdateGridMap (XYZDataset oDataset, JInternalFrame jFrame, Legend oLegend, XYCellRenderer oRenderer) throws ModelException
 Updates a grid map with a fresh dataset.
static ModelInternalFrame DrawHistogram (ModelHistogramDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, Legend oLegend, HistogramDataRequest oRequest) throws ModelException
 Creates a histogram and returns it in a ChartPanel.
static ModelInternalFrame DrawHistogram (ModelHistogramDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, Legend oLegend, GridHistogramDataRequest oRequest) throws ModelException
 Creates a histogram and returns it in a ChartPanel.
static ModelInternalFrame AddFileMenu (ModelInternalFrame jFrame, java.awt.event.ActionListener oListener, boolean bAllTimesteps)
 Adds a file menu with a save command to a frame.
static ModelInternalFrame DrawLineChart (DefaultXYDataset oDataset, java.awt.event.ActionListener oListener, String sXAxisLabel, String sYAxisLabel, String sTitle, Legend oLegend, JCheckBox jUseTotals, int iNumSpecies) throws ModelException
 Draws a line graph using the given dataset and places it in a JInternalFrame as the content pane.
static ModelInternalFrame DrawTreeMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, int iXLength, int iYLength, float fDbhScaleFactor, float fMinDbh, java.awt.event.ActionListener oListener, Legend oLegend) throws ModelException
 Creates a tree map and places it as a content pane in a new JInternalFrame object.
static ModelInternalFrame DrawGridMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, int iXLength, int iYLength, Legend oLegend, XYCellRenderer oRenderer, GridDataRequest oRequest) throws ModelException
 Creates a grayscale grid map and places it as a content pane in a new JInternalFrame object.
static ChartPanel MakeOverlaidMap (XYZDataset oPrimaryDataset, XYZDataset oSecondaryDataset, String sAxisLabel, String sYAxisLabel, int iXLength, int iYLength, XYItemRenderer oPrimaryRenderer, XYItemRenderer oSecondaryRenderer, Dimension jPreferredSize)
 Makes an overlaid map.
static ModelInternalFrame DrawOverviewTables (String sChartTitle, Object[][] p_oSeedlingData, Object[][] p_oSaplingData, Object[][] p_oAdultData, Object[][] p_oSnagData, Legend oLegend, java.awt.event.ActionListener oListener) throws javawrapper. ModelException
 Creates a set of overview tables packaged into a JPanel.
static void UpdateOverviewTables (JPanel jTablePanel, Object[][] p_oSeedlingData, Object[][] p_oSaplingData, Object[][] p_oAdultData, Object[][] p_oSnagData)
 Updates the overview tables with new data without rebuilding the whole window.
static java.awt.Component FindNamedComponent (java.awt.Component jParent, String sName)
 Finds a named component within another component.
static boolean ReplaceNamedComponent (java.awt.Component jParent, java.awt.Component jToReplaceWith, String sName)
 Replaces a named component with another component.


Detailed Description

Objects of this class can create graphs of various kinds, given data.

The functions you are most likely to call are the Draw[X] and Update[X].

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)
May 11, 2004: Made all the functions static (LEM)
July 19, 2004: Preserved user resizing of charts (LEM)


Member Function Documentation

static void datavisualizer::DataGrapher::UpdateLineChart ( DefaultXYDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
JCheckBox  jUseTotals,
int  iNumSpecies 
) throws ModelException [inline, static]

Updates a line chart in a window with a fresh dataset.

The old content pane is replaced with a new one, so do not count on existing content pane references to the window working.

Parameters:
oDataset The new dataset.
jFrame The window in which to update the chart.
oLegend The legend for this chart.
jUseTotals Checkbox for whether or not to use totals. Can be null.
iNumSpecies The number of total species there are.
Exceptions:
ModelException Passing through underlying exceptions.

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

static void datavisualizer::DataGrapher::UpdateHistogram ( ModelHistogramDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
HistogramDataRequest  oRequest 
) throws ModelException [inline, static]

Updates a histogram with a fresh dataset.

Parameters:
oDataset The new dataset.
jFrame The window in which to update the chart.
oLegend The legend for this chart.
oRequest The HistogramDataRequest object for this chart.
Exceptions:
ModelException Passing through underlying exceptions.

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

static void datavisualizer::DataGrapher::UpdateHistogram ( ModelHistogramDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
GridHistogramDataRequest  oRequest 
) throws ModelException [inline, static]

Updates a histogram with a fresh dataset.

Parameters:
oDataset The new dataset.
jFrame The window in which to update the chart.
oLegend The legend for this chart.
oRequest The GridHistogramDataRequest object for this chart.
Exceptions:
ModelException Passing through underlying exceptions.

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

static void datavisualizer::DataGrapher::UpdateTreeMap ( XYZDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
float  fDbhScaleFactor,
float  fMinDbh 
) throws ModelException [inline, static]

Updates a tree map with a fresh dataset.

The old content pane is replaced with a new one, so do not count on existing content pane references to the window working.

Parameters:
oDataset The new dataset.
jFrame The window in which to update the chart.
oLegend The legend for this map.
fDbhScaleFactor The scale factor which controls how large trees appear
fMinDbh The minimum DBH of trees to display
Exceptions:
ModelException Passing through underlying exceptions.

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
November 15, 2004: Made this smarter about replacing the chart (LEM)

static void datavisualizer::DataGrapher::UpdateGridMap ( XYZDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
XYCellRenderer  oRenderer 
) throws ModelException [inline, static]

Updates a grid map with a fresh dataset.

Parameters:
oDataset The new dataset.
jFrame The window in which to update the chart.
oLegend The legend for this map.
oRenderer The XYCellRenderer, or null if the defaults are OK. If you provided it to draw the original chart, you must provide it again to keep the grayscale values the same.
Exceptions:
ModelException Passing through underlying exceptions.

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

static ModelInternalFrame datavisualizer::DataGrapher::DrawHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
HistogramDataRequest  oRequest 
) throws ModelException [inline, static]

Creates a histogram and returns it in a ChartPanel.

Parameters:
oDataset The dataset from which to create a histogram.
sXAxisLabel The X axis label
sYAxisLabel The Y axis label
sTitle Chart title.
oLegend The legend for this chart.
oRequest The HistogramDataRequest object for this chart.
Returns:
The chart in a ChartPanel.
Exceptions:
ModelException if something goes wrong with the chart.

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

static ModelInternalFrame datavisualizer::DataGrapher::DrawHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
GridHistogramDataRequest  oRequest 
) throws ModelException [inline, static]

Creates a histogram and returns it in a ChartPanel.

Parameters:
oDataset The dataset from which to create a histogram.
sXAxisLabel The X axis label
sYAxisLabel The Y axis label
sTitle Chart title.
oLegend The legend for this chart.
oRequest The HistogramDataRequest object for this chart.
Returns:
The chart in a ChartPanel.
Exceptions:
ModelException if something goes wrong with the chart.

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

static ModelInternalFrame datavisualizer::DataGrapher::AddFileMenu ( ModelInternalFrame  jFrame,
java.awt.event.ActionListener  oListener,
boolean  bAllTimesteps 
) [inline, static]

Adds a file menu with a save command to a frame.

The command action string is "WriteChartData".

Parameters:
jFrame JInternalFrame The frame to add the menu to.
oListener The listener to add to the file save command.
bAllTimesteps Whether to add an option for saving for all timesteps.
Returns:
JInternalFrame The frame, with the menu added.

static ModelInternalFrame datavisualizer::DataGrapher::DrawLineChart ( DefaultXYDataset  oDataset,
java.awt.event.ActionListener  oListener,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
JCheckBox  jUseTotals,
int  iNumSpecies 
) throws ModelException [inline, static]

Draws a line graph using the given dataset and places it in a JInternalFrame as the content pane.

The JInternalFrame is not sized or made visible.

The chart comes without a legend or title.

Parameters:
oDataset The dataset to draw.
oListener The ActionListener that will respond to the file save command string "WriteChartData"
sXAxisLabel The X axis label
sYAxisLabel The Y axis label
sTitle The window title for the chart
oLegend The legend for this chart
jUseTotals Checkbox for whether or not to use totals. Can be null.
iNumSpecies Number of species, total.
Returns:
The chart.
Exceptions:
ModelException if anything goes wrong with drawing the chart.

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

static ModelInternalFrame datavisualizer::DataGrapher::DrawTreeMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
int  iXLength,
int  iYLength,
float  fDbhScaleFactor,
float  fMinDbh,
java.awt.event.ActionListener  oListener,
Legend  oLegend 
) throws ModelException [inline, static]

Creates a tree map and places it as a content pane in a new JInternalFrame object.

The JInternalFrame object is not sized or made visible.

The tree map is created with a variation on the XYBubbleRenderer in JFreeChart called XYTreeRenderer, which draws the trees as circles. The chart comes without a legend or title.

Parameters:
oDataset The data to make into a map.
sXAxisLabel The X axis label.
sYAxisLabel The Y axis label.
sTitle The window title for the chart.
iXLength Length of the plot in the X direction, in meters
iYLength Length of the plot in the Y direction, in meters
fDbhScaleFactor The scale factor which controls how large trees appear
fMinDbh The minimum DBH of trees to display
oListener The ActionListener that will respond to the file save command string "WriteChartData"
oLegend The legend for this chart.
Returns:
The chart in a JInternalFrame.
Exceptions:
ModelException if something goes wrong with the chart.

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

static ModelInternalFrame datavisualizer::DataGrapher::DrawGridMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
int  iXLength,
int  iYLength,
Legend  oLegend,
XYCellRenderer  oRenderer,
GridDataRequest  oRequest 
) throws ModelException [inline, static]

Creates a grayscale grid map and places it as a content pane in a new JInternalFrame object.

The JInternalFrame object is not sized or made visible.

The grid map is drawn by an XYCellRenderer object. This object can be pre-created and passed to control the grayscale and where it is applied to various grid values.

Parameters:
oDataset The data to make into a map.
sXAxisLabel The X axis label.
sYAxisLabel The Y axis label.
sTitle The window title for the chart.
iXLength Length of the plot in the X direction, in meters
iYLength Length of the plot in the Y direction, in meters
oLegend The legend for this chart.
oRenderer The XYCellRenderer, or null if the defaults are OK.
oRequest The GridDataRequest object that owns the frame.
Returns:
The chart in a JInternalFrame.
Exceptions:
ModelException if something goes wrong with the chart.

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

static ChartPanel datavisualizer::DataGrapher::MakeOverlaidMap ( XYZDataset  oPrimaryDataset,
XYZDataset  oSecondaryDataset,
String  sAxisLabel,
String  sYAxisLabel,
int  iXLength,
int  iYLength,
XYItemRenderer  oPrimaryRenderer,
XYItemRenderer  oSecondaryRenderer,
Dimension  jPreferredSize 
) [inline, static]

Makes an overlaid map.

Parameters:
oPrimaryDataset XYZDataset First dataset to chart
oSecondaryDataset XYZDataset Second dataset to chart, on top of first
sAxisLabel String Label of X axis
sYAxisLabel String Label of Y axis
iXLength int Length of plot in X direction in meters
iYLength int Length of plot in Y direction in meters
oPrimaryRenderer XYItemRenderer Renderer for primary dataset
oSecondaryRenderer XYItemRenderer Renderer for secondary dataset
jPreferredSize Dimension Preferred chart size
Returns:
ChartPanel Overlaid map chart panel

static ModelInternalFrame datavisualizer::DataGrapher::DrawOverviewTables ( String  sChartTitle,
Object  p_oSeedlingData[][],
Object  p_oSaplingData[][],
Object  p_oAdultData[][],
Object  p_oSnagData[][],
Legend  oLegend,
java.awt.event.ActionListener  oListener 
) throws javawrapper. ModelException [inline, static]

Creates a set of overview tables packaged into a JPanel.

The overview tables contain information on density and basal area for each tree type. The four tables appear in two rows: adults and saplings on top, and seedlings and snags on the bottom. This method expects no null arrays, although null values within the array are all right. They will appear as blanks. A column of species names is added to each dataset as the first column in the table.

The tables themselves are named, so they can be found later and updated without rebuilding the entire panel. The seedling table is named "seedling_table", the sapling table is named "sapling_table", the adult table is named "adult_table", and the snag table is named "snag_table".

Parameters:
sChartTitle Chart window table.
p_oSeedlingData The seedling dataset. The first array index is rows, one per species, with the last row showing totals. The single column is for absolute density.
p_oSaplingData The sapling dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.
p_oAdultData The adult dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.
p_oSnagData The snag dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.
oLegend The legend that goes with these tables, for extracting species display names.
oListener The ActionListener that will respond to the file save command string "WriteChartData"
Returns:
The panel with the four tables within it plus appropriate labels.
Exceptions:
ModelException passed through from calling methods; should never be thrown.

static void datavisualizer::DataGrapher::UpdateOverviewTables ( JPanel  jTablePanel,
Object  p_oSeedlingData[][],
Object  p_oSaplingData[][],
Object  p_oAdultData[][],
Object  p_oSnagData[][] 
) [inline, static]

Updates the overview tables with new data without rebuilding the whole window.

This finds the tables within a panel and sets the values cell-by-cell from the datasets passed in. The tables can be children at any level of the panel being passed - it will be recursively searched to find them. The species names in column one are not touched, only the data values.

Parameters:
jTablePanel The component containing the tables within it.
p_oSeedlingData The seedling dataset. The first array index is rows, one per species, with the last row showing totals. The single column is for absolute density.
p_oSaplingData The sapling dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.
p_oAdultData The adult dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.
p_oSnagData The snag dataset. The first array index is rows, one per species, with the last row showing totals. The four columns are 1) absolute density, 2) percent of density, 3) absolute basal area, and 4) percent basal area.

static java.awt.Component datavisualizer::DataGrapher::FindNamedComponent ( java.awt.Component  jParent,
String  sName 
) [inline, static]

Finds a named component within another component.

This recursively searches all children of the parent component to find the named component.

Parameters:
jParent The parent component in which to search.
sName The name of the component to find.
Returns:
The component, or null if it could not be found.

static boolean datavisualizer::DataGrapher::ReplaceNamedComponent ( java.awt.Component  jParent,
java.awt.Component  jToReplaceWith,
String  sName 
) [inline, static]

Replaces a named component with another component.

This recursively searches all children of the parent component to find the named component, and then places the new component in its place.

Parameters:
jParent The parent component in which to search.
jToReplaceWith The component with which to replace the named component.
sName The name of the component to find.
Returns:
The component, or null if it could not be found.


The documentation for this class was generated from the following file:
Generated on Thu May 24 09:34:51 2007 for SORTIE Java Interface by  doxygen 1.5.2