SORTIE Java Interface  1
Static Public Member Functions | Static Private Member Functions | List of all members
sortie.datavisualizer.DataGrapher Class Reference

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

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. More...
 
static void updateGenericLineChart (DefaultXYDataset oDataset, JInternalFrame jFrame, NoSpeciesLegend oLegend) throws ModelException
 Updates a line chart in a window with a fresh dataset. More...
 
static void updateHistogram (ModelHistogramDataset oDataset, JInternalFrame jFrame, Legend oLegend, HistogramDataRequest oRequest) throws ModelException
 Updates a histogram with a fresh dataset. More...
 
static void updateHistogram (ModelHistogramDataset oDataset, JInternalFrame jFrame, Legend oLegend, GridAllSpeciesHistogramDataRequest oRequest) throws ModelException
 Updates a histogram with a fresh dataset. More...
 
static void updateHistogram (ModelHistogramDataset oDataset, JInternalFrame jFrame, Legend oLegend, GridHistogramDataRequest oRequest) throws ModelException
 Updates a histogram with a fresh dataset. More...
 
static void updateTreeMap (XYZDataset oDataset, JInternalFrame jFrame, Legend oLegend, float fDbhScaleFactor, float fMinDbh, float fEntireXAxisLength, float fEntireYAxisLength) throws ModelException
 Updates a tree map with a fresh dataset. More...
 
static void updateTreeMap (XYZDataset oDataset, JPanel jParentPanel, Color[] p_oSpeciesColors, float fDbhScaleFactor, float fMinDbh, float fEntireXAxisLength, float fEntireYAxisLength) throws ModelException
 Updates a tree map with a fresh dataset. More...
 
static void updateGridMap (XYZDataset oDataset, double fMin, double fMax, JInternalFrame jFrame, Legend oLegend, XYCellRenderer oRenderer) throws ModelException
 Updates a grid map with a fresh dataset. More...
 
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. More...
 
static ModelInternalFrame drawHistogram (ModelHistogramDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, Legend oLegend, GridAllSpeciesHistogramDataRequest oRequest) throws ModelException
 Creates a histogram and returns it in a ChartPanel. More...
 
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. More...
 
static ModelInternalFrame addFileMenu (ModelInternalFrame jFrame, ActionListener oListener, boolean bAllTimesteps)
 Adds a file menu with a save command to a frame. More...
 
static ModelInternalFrame drawLineChart (DefaultXYDataset oDataset, 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. More...
 
static ModelInternalFrame drawGenericLineChart (DefaultXYDataset oDataset, ActionListener oListener, String sXAxisLabel, String sYAxisLabel, String sTitle, Legend oSppLegend, NoSpeciesLegend oLegend) throws ModelException
 Draws a line graph using the given dataset and places it in a JInternalFrame as the content pane. More...
 
static ModelInternalFrame drawTreeMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, int iXLength, int iYLength, float fDbhScaleFactor, float fMinDbh, float fEntireXAxisLength, float fEntireYAxisLength, ActionListener oListener, Legend oLegend) throws ModelException
 Creates a tree map and places it as a content pane in a new JInternalFrame object. More...
 
static ChartPanel drawTreeMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, int iXLength, int iYLength, float fDbhScaleFactor, float fMinDbh, float fEntireXAxisLength, float fEntireYAxisLength, ActionListener oListener, Color[] p_oSpeciesColors) throws ModelException
 Creates a tree map and places it as a content pane in a new JInternalFrame object. More...
 
static ModelInternalFrame drawGridMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, String sTitle, int iXLength, int iYLength, double fMin, double fMax, 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. More...
 
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. More...
 
static ModelInternalFrame drawOverviewTables (String sChartTitle, Object[][] p_oSeedlingData, Object[][] p_oSaplingData, Object[][] p_oAdultData, Object[][] p_oSnagData, Legend oLegend, ActionListener oListener) throws ModelException
 Creates a set of overview tables packaged into a JPanel. More...
 
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. More...
 
static Component findNamedComponent (Component jParent, String sName)
 Finds a named component within another component. More...
 
static boolean replaceNamedComponent (Component jParent, Component jToReplaceWith, String sName)
 Replaces a named component with another component. More...
 

Static Private Member Functions

static ChartPanel makeLineChart (DefaultXYDataset oDataset, String sXAxisLabel, String sYAxisLabel, Legend oLegend, int iNumSpecies, Dimension jPreferredSize) throws ModelException
 Draws a line graph using the given dataset and returns a ChartPanel containing the desired chart. More...
 
static ChartPanel makeGenericLineChart (DefaultXYDataset oDataset, String sXAxisLabel, String sYAxisLabel, NoSpeciesLegend oLegend, Dimension jPreferredSize) throws ModelException
 Draws a line graph using the given dataset and returns a ChartPanel containing the desired chart. More...
 
static ChartPanel makeTreeMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, double start, double end, double start2, double end2, double dbhScaleFactor, double minDbh, double entireXAxisLength, double entireYAxisLength, Color[] p_oSpeciesColors, Dimension jPreferredSize) throws ModelException
 Creates a tree map and returns it in a ChartPanel. More...
 
static ChartPanel makeGridMap (XYZDataset oDataset, String sXAxisLabel, String sYAxisLabel, int iXLength, int iYLength, Legend oLegend, XYCellRenderer oRenderer, Dimension jPreferredSize) throws ModelException
 Creates a grid map and returns it in a ChartPanel. More...
 
static JPanel makeOverviewTables (Object[][] p_oSeedlingData, Object[][] p_oSaplingData, Object[][] p_oAdultData, Object[][] p_oSnagData, Legend oLegend) throws ModelException
 Creates a set of overview tables packaged into a JPanel. More...
 
static ChartPanel makeHistogramBySpecies (ModelHistogramDataset oDataset, String sXAxisLabel, String sYAxisLabel, Legend oLegend, boolean bUseLogarithmicAxis, float fBinSize, Dimension jPreferredSize) throws ModelException
 Creates a histogram and returns it in a ChartPanel. More...
 
static ChartPanel makeHistogram (ModelHistogramDataset oDataset, String sXAxisLabel, String sYAxisLabel, Legend oLegend, GridHistogramDataRequest oRequest, Dimension jPreferredSize) throws ModelException
 Creates a histogram and returns it in a ChartPanel. More...
 

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: 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)

Member Function Documentation

◆ addFileMenu()

static ModelInternalFrame sortie.datavisualizer.DataGrapher.addFileMenu ( ModelInternalFrame  jFrame,
ActionListener  oListener,
boolean  bAllTimesteps 
)
static

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

The command action string is "WriteChartData".

Parameters
jFrameJInternalFrame The frame to add the menu to.
oListenerThe listener to add to the file save command.
bAllTimestepsWhether to add an option for saving for all timesteps.
Returns
JInternalFrame The frame, with the menu added.

◆ drawGenericLineChart()

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawGenericLineChart ( DefaultXYDataset  oDataset,
ActionListener  oListener,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oSppLegend,
NoSpeciesLegend  oLegend 
) throws ModelException
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
oDatasetThe dataset to draw.
oListenerThe ActionListener that will respond to the file save command string "WriteChartData"
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
sTitleThe window title for the chart
oLegendThe legend for this chart
oSppLegendLegend with species list
Returns
The chart.
Exceptions
ModelExceptionif anything goes wrong with drawing the chart.

◆ drawGridMap()

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawGridMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
int  iXLength,
int  iYLength,
double  fMin,
double  fMax,
Legend  oLegend,
XYCellRenderer  oRenderer,
GridDataRequest  oRequest 
) throws ModelException
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
oDatasetThe data to make into a map.
sXAxisLabelThe X axis label.
sYAxisLabelThe Y axis label.
sTitleThe window title for the chart.
iXLengthLength of the plot in the X direction, in meters
iYLengthLength of the plot in the Y direction, in meters
fMinMinimum dataset value, to be displayed.
fMaxMaximum dataset value, to be displayed.
oLegendThe legend for this chart.
oRendererThe XYCellRenderer, or null if the defaults are OK.
oRequestThe GridDataRequest object that owns the frame.
Returns
The chart in a JInternalFrame.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ drawHistogram() [1/3]

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
HistogramDataRequest  oRequest 
) throws ModelException
static

Creates a histogram and returns it in a ChartPanel.

Parameters
oDatasetThe dataset from which to create a histogram.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
sTitleChart title.
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ drawHistogram() [2/3]

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
GridAllSpeciesHistogramDataRequest  oRequest 
) throws ModelException
static

Creates a histogram and returns it in a ChartPanel.

Parameters
oDatasetThe dataset from which to create a histogram.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
sTitleChart title.
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ drawHistogram() [3/3]

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
GridHistogramDataRequest  oRequest 
) throws ModelException
static

Creates a histogram and returns it in a ChartPanel.

Parameters
oDatasetThe dataset from which to create a histogram.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
sTitleChart title.
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ drawLineChart()

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawLineChart ( DefaultXYDataset  oDataset,
ActionListener  oListener,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
Legend  oLegend,
JCheckBox  jUseTotals,
int  iNumSpecies 
) throws ModelException
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
oDatasetThe dataset to draw.
oListenerThe ActionListener that will respond to the file save command string "WriteChartData"
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
sTitleThe window title for the chart
oLegendThe legend for this chart
jUseTotalsCheckbox for whether or not to use totals. Can be null.
iNumSpeciesNumber of species, total.
Returns
The chart.
Exceptions
ModelExceptionif anything goes wrong with drawing the chart.

◆ drawOverviewTables()

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawOverviewTables ( String  sChartTitle,
Object  p_oSeedlingData[][],
Object  p_oSaplingData[][],
Object  p_oAdultData[][],
Object  p_oSnagData[][],
Legend  oLegend,
ActionListener  oListener 
) throws ModelException
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
sChartTitleChart window table.
p_oSeedlingDataThe 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_oSaplingDataThe 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_oAdultDataThe 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_oSnagDataThe 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.
oLegendThe legend that goes with these tables, for extracting species display names.
oListenerThe ActionListener that will respond to the file save command string "WriteChartData"
Returns
The panel with the four tables within it plus appropriate labels.
Exceptions
ModelExceptionpassed through from calling methods; should never be thrown.

◆ drawTreeMap() [1/2]

static ModelInternalFrame sortie.datavisualizer.DataGrapher.drawTreeMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
int  iXLength,
int  iYLength,
float  fDbhScaleFactor,
float  fMinDbh,
float  fEntireXAxisLength,
float  fEntireYAxisLength,
ActionListener  oListener,
Legend  oLegend 
) throws ModelException
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
oDatasetThe data to make into a map.
sXAxisLabelThe X axis label.
sYAxisLabelThe Y axis label.
sTitleThe window title for the chart.
iXLengthLength of the plot in the X direction, in meters
iYLengthLength of the plot in the Y direction, in meters
fDbhScaleFactorThe scale factor which controls how large trees appear
fMinDbhThe minimum DBH of trees to display
fEntireXAxisLengthFull length of the plot X axis, in meters, so trees can be rendered at the proper size.
fEntireYAxisLengthFull length of the plot Y axis, in meters, so trees can be rendered at the proper size.
oListenerThe ActionListener that will respond to the file save command string "WriteChartData"
oLegendThe legend for this chart.
Returns
The chart in a JInternalFrame.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ drawTreeMap() [2/2]

static ChartPanel sortie.datavisualizer.DataGrapher.drawTreeMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
String  sTitle,
int  iXLength,
int  iYLength,
float  fDbhScaleFactor,
float  fMinDbh,
float  fEntireXAxisLength,
float  fEntireYAxisLength,
ActionListener  oListener,
Color []  p_oSpeciesColors 
) throws ModelException
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
oDatasetThe data to make into a map.
sXAxisLabelThe X axis label.
sYAxisLabelThe Y axis label.
sTitleThe window title for the chart.
iXLengthLength of the plot in the X direction, in meters
iYLengthLength of the plot in the Y direction, in meters
fDbhScaleFactorThe scale factor which controls how large trees appear
fMinDbhThe minimum DBH of trees to display
fEntireXAxisLengthLength of the full plot X axis, in meters
fEntireYAxisLengthLength of the full plot Y axis, in meters
oListenerThe ActionListener that will respond to the file save command string "WriteChartData"
p_oSpeciesColorsArray of colors for each species
Returns
The chart panel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ findNamedComponent()

static Component sortie.datavisualizer.DataGrapher.findNamedComponent ( Component  jParent,
String  sName 
)
static

Finds a named component within another component.

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

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

◆ makeGenericLineChart()

static ChartPanel sortie.datavisualizer.DataGrapher.makeGenericLineChart ( DefaultXYDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
NoSpeciesLegend  oLegend,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Draws a line graph using the given dataset and returns a ChartPanel containing the desired chart.

This is for a line graph not based on species.

The chart comes without a legend or title.

Parameters
oDatasetThe dataset to draw.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
oLegendThe legend for this chart
jPreferredSizeChart's size.
Returns
The chart.
Exceptions
ModelExceptionif anything goes wrong with drawing the chart.

◆ makeGridMap()

static ChartPanel sortie.datavisualizer.DataGrapher.makeGridMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
int  iXLength,
int  iYLength,
Legend  oLegend,
XYCellRenderer  oRenderer,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Creates a grid map and returns it in a ChartPanel.

Parameters
oDatasetThe data to make into a map.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
iXLengthLength of the plot in the X direction, in meters
iYLengthLength of the plot in the Y direction, in meters
oLegendThe legend for this chart.
oRendererXYCellRenderer object. If NULL, this will create one.
jPreferredSizeChart's size.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ makeHistogram()

static ChartPanel sortie.datavisualizer.DataGrapher.makeHistogram ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
Legend  oLegend,
GridHistogramDataRequest  oRequest,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Creates a histogram and returns it in a ChartPanel.

Parameters
oDatasetThe dataset from which to create a histogram.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
jPreferredSizeChart's size.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ makeHistogramBySpecies()

static ChartPanel sortie.datavisualizer.DataGrapher.makeHistogramBySpecies ( ModelHistogramDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
Legend  oLegend,
boolean  bUseLogarithmicAxis,
float  fBinSize,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Creates a histogram and returns it in a ChartPanel.

Parameters
oDatasetThe dataset from which to create a histogram.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
oLegendThe legend for this chart.
bUseLogarithmicAxisWhether or not to use a logarithmic axis.
fBinSizeHistogram bin size.
jPreferredSizeChart's size.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ makeLineChart()

static ChartPanel sortie.datavisualizer.DataGrapher.makeLineChart ( DefaultXYDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
Legend  oLegend,
int  iNumSpecies,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Draws a line graph using the given dataset and returns a ChartPanel containing the desired chart.

The chart comes without a legend or title.

Parameters
oDatasetThe dataset to draw.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
oLegendThe legend for this chart
iNumSpeciesNumber of species, total.
jPreferredSizeChart's size.
Returns
The chart.
Exceptions
ModelExceptionif anything goes wrong with drawing the chart.

◆ makeOverlaidMap()

static ChartPanel sortie.datavisualizer.DataGrapher.makeOverlaidMap ( XYZDataset  oPrimaryDataset,
XYZDataset  oSecondaryDataset,
String  sAxisLabel,
String  sYAxisLabel,
int  iXLength,
int  iYLength,
XYItemRenderer  oPrimaryRenderer,
XYItemRenderer  oSecondaryRenderer,
Dimension  jPreferredSize 
)
static

Makes an overlaid map.

Parameters
oPrimaryDatasetXYZDataset First dataset to chart
oSecondaryDatasetXYZDataset Second dataset to chart, on top of first
sAxisLabelString Label of X axis
sYAxisLabelString Label of Y axis
iXLengthint Length of plot in X direction in meters
iYLengthint Length of plot in Y direction in meters
oPrimaryRendererXYItemRenderer Renderer for primary dataset
oSecondaryRendererXYItemRenderer Renderer for secondary dataset
jPreferredSizeDimension Preferred chart size
Returns
ChartPanel Overlaid map chart panel

◆ makeOverviewTables()

static JPanel sortie.datavisualizer.DataGrapher.makeOverviewTables ( Object  p_oSeedlingData[][],
Object  p_oSaplingData[][],
Object  p_oAdultData[][],
Object  p_oSnagData[][],
Legend  oLegend 
) throws ModelException
staticprivate

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
p_oSeedlingDataThe 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_oSaplingDataThe 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_oAdultDataThe 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_oSnagDataThe 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.
oLegendThe legend that goes with these tables, for extracting species display names.
Returns
The panel with the four tables within it plus appropriate labels.
Exceptions
ModelExceptionpassed through from calling methods; should never be thrown.

◆ makeTreeMap()

static ChartPanel sortie.datavisualizer.DataGrapher.makeTreeMap ( XYZDataset  oDataset,
String  sXAxisLabel,
String  sYAxisLabel,
double  start,
double  end,
double  start2,
double  end2,
double  dbhScaleFactor,
double  minDbh,
double  entireXAxisLength,
double  entireYAxisLength,
Color []  p_oSpeciesColors,
Dimension  jPreferredSize 
) throws ModelException
staticprivate

Creates a tree map and returns it in a ChartPanel.

Parameters
oDatasetThe data to make into a map.
sXAxisLabelThe X axis label
sYAxisLabelThe Y axis label
startStart coordinate of the X axis, in meters
endEnd coordinate of the X axis, in meters
start2Start coordinate of the Y axis, in meters
end2End coordinate of the Y axis, in meters
dbhScaleFactorThe scale factor which controls how large trees appear
minDbhThe minimum diameter of trees to display
entireXAxisLengthFull length of the plot X axis, in meters, so trees can be rendered at the proper size.
entireYAxisLengthFull length of the plot Y axis, in meters, so trees can be rendered at the proper size.
p_oSpeciesColorsAn array of the preferred color for each species.
jPreferredSizeChart's size.
Returns
The chart in a ChartPanel.
Exceptions
ModelExceptionif something goes wrong with the chart.

◆ replaceNamedComponent()

static boolean sortie.datavisualizer.DataGrapher.replaceNamedComponent ( Component  jParent,
Component  jToReplaceWith,
String  sName 
)
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
jParentThe parent component in which to search.
jToReplaceWithThe component with which to replace the named component.
sNameThe name of the component to find.
Returns
The component, or null if it could not be found.

◆ updateGenericLineChart()

static void sortie.datavisualizer.DataGrapher.updateGenericLineChart ( DefaultXYDataset  oDataset,
JInternalFrame  jFrame,
NoSpeciesLegend  oLegend 
) throws ModelException
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
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this chart.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateGridMap()

static void sortie.datavisualizer.DataGrapher.updateGridMap ( XYZDataset  oDataset,
double  fMin,
double  fMax,
JInternalFrame  jFrame,
Legend  oLegend,
XYCellRenderer  oRenderer 
) throws ModelException
static

Updates a grid map with a fresh dataset.

Parameters
oDatasetThe new dataset.
fMinMinimum dataset value, to be displayed.
fMaxMaximum dataset value, to be displayed.
jFrameThe window in which to update the chart.
oLegendThe legend for this map.
oRendererThe 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
ModelExceptionPassing through underlying exceptions.

◆ updateHistogram() [1/3]

static void sortie.datavisualizer.DataGrapher.updateHistogram ( ModelHistogramDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
HistogramDataRequest  oRequest 
) throws ModelException
static

Updates a histogram with a fresh dataset.

Parameters
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateHistogram() [2/3]

static void sortie.datavisualizer.DataGrapher.updateHistogram ( ModelHistogramDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
GridAllSpeciesHistogramDataRequest  oRequest 
) throws ModelException
static

Updates a histogram with a fresh dataset.

Parameters
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this chart.
oRequestThe HistogramDataRequest object for this chart.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateHistogram() [3/3]

static void sortie.datavisualizer.DataGrapher.updateHistogram ( ModelHistogramDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
GridHistogramDataRequest  oRequest 
) throws ModelException
static

Updates a histogram with a fresh dataset.

Parameters
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this chart.
oRequestThe GridHistogramDataRequest object for this chart.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateLineChart()

static void sortie.datavisualizer.DataGrapher.updateLineChart ( DefaultXYDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
JCheckBox  jUseTotals,
int  iNumSpecies 
) throws ModelException
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
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this chart.
jUseTotalsCheckbox for whether or not to use totals. Can be null.
iNumSpeciesThe number of total species there are.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateOverviewTables()

static void sortie.datavisualizer.DataGrapher.updateOverviewTables ( JPanel  jTablePanel,
Object  p_oSeedlingData[][],
Object  p_oSaplingData[][],
Object  p_oAdultData[][],
Object  p_oSnagData[][] 
)
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
jTablePanelThe component containing the tables within it.
p_oSeedlingDataThe 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_oSaplingDataThe 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_oAdultDataThe 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_oSnagDataThe 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.

◆ updateTreeMap() [1/2]

static void sortie.datavisualizer.DataGrapher.updateTreeMap ( XYZDataset  oDataset,
JInternalFrame  jFrame,
Legend  oLegend,
float  fDbhScaleFactor,
float  fMinDbh,
float  fEntireXAxisLength,
float  fEntireYAxisLength 
) throws ModelException
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
oDatasetThe new dataset.
jFrameThe window in which to update the chart.
oLegendThe legend for this map.
fDbhScaleFactorThe scale factor which controls how large trees appear
fMinDbhThe minimum DBH of trees to display
fEntireXAxisLengthFull length of the plot X axis, in meters, so trees can be rendered at the proper size.
fEntireYAxisLengthFull length of the plot Y axis, in meters, so trees can be rendered at the proper size.
Exceptions
ModelExceptionPassing through underlying exceptions.

◆ updateTreeMap() [2/2]

static void sortie.datavisualizer.DataGrapher.updateTreeMap ( XYZDataset  oDataset,
JPanel  jParentPanel,
Color []  p_oSpeciesColors,
float  fDbhScaleFactor,
float  fMinDbh,
float  fEntireXAxisLength,
float  fEntireYAxisLength 
) throws ModelException
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
oDatasetThe new dataset.
jParentPanelThe window in which to update the chart.
p_oSpeciesColorsColors for each species.
fDbhScaleFactorThe scale factor which controls how large trees appear
fMinDbhThe minimum DBH of trees to display
fEntireXAxisLengthFull length of the plot X axis, in meters, so trees can be rendered at the proper size.
fEntireYAxisLengthFull length of the plot Y axis, in meters, so trees can be rendered at the proper size.
Exceptions
ModelExceptionPassing through underlying exceptions.

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