SORTIE Java Interface
1
|
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... | |
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
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
|
static |
Adds a file menu with a save command to a frame.
The command action string is "WriteChartData".
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. |
|
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.
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 |
oSppLegend | Legend with species list |
ModelException | if anything goes wrong with drawing the chart. |
|
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.
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 |
fMin | Minimum dataset value, to be displayed. |
fMax | Maximum dataset value, to be displayed. |
oLegend | The legend for this chart. |
oRenderer | The XYCellRenderer, or null if the defaults are OK. |
oRequest | The GridDataRequest object that owns the frame. |
ModelException | if something goes wrong with the chart. |
|
static |
Creates a histogram and returns it in a ChartPanel.
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. |
ModelException | if something goes wrong with the chart. |
|
static |
Creates a histogram and returns it in a ChartPanel.
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. |
ModelException | if something goes wrong with the chart. |
|
static |
Creates a histogram and returns it in a ChartPanel.
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. |
ModelException | if something goes wrong with the chart. |
|
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.
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. |
ModelException | if anything goes wrong with drawing the chart. |
|
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".
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" |
ModelException | passed through from calling methods; should never be thrown. |
|
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.
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 |
fEntireXAxisLength | Full length of the plot X axis, in meters, so trees can be rendered at the proper size. |
fEntireYAxisLength | Full length of the plot Y axis, in meters, so trees can be rendered at the proper size. |
oListener | The ActionListener that will respond to the file save command string "WriteChartData" |
oLegend | The legend for this chart. |
ModelException | if something goes wrong with the chart. |
|
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.
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 |
fEntireXAxisLength | Length of the full plot X axis, in meters |
fEntireYAxisLength | Length of the full plot Y axis, in meters |
oListener | The ActionListener that will respond to the file save command string "WriteChartData" |
p_oSpeciesColors | Array of colors for each species |
ModelException | if something goes wrong with the chart. |
|
static |
Finds a named component within another component.
This recursively searches all children of the parent component to find the named component.
jParent | The parent component in which to search. |
sName | The name of the component to find. |
|
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.
oDataset | The dataset to draw. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
oLegend | The legend for this chart |
jPreferredSize | Chart's size. |
ModelException | if anything goes wrong with drawing the chart. |
|
staticprivate |
Creates a grid map and returns it in a ChartPanel.
oDataset | The data to make into a map. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
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 | XYCellRenderer object. If NULL, this will create one. |
jPreferredSize | Chart's size. |
ModelException | if something goes wrong with the chart. |
|
staticprivate |
Creates a histogram and returns it in a ChartPanel.
oDataset | The dataset from which to create a histogram. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
oLegend | The legend for this chart. |
oRequest | The HistogramDataRequest object for this chart. |
jPreferredSize | Chart's size. |
ModelException | if something goes wrong with the chart. |
|
staticprivate |
Creates a histogram and returns it in a ChartPanel.
oDataset | The dataset from which to create a histogram. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
oLegend | The legend for this chart. |
bUseLogarithmicAxis | Whether or not to use a logarithmic axis. |
fBinSize | Histogram bin size. |
jPreferredSize | Chart's size. |
ModelException | if something goes wrong with the chart. |
|
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.
oDataset | The dataset to draw. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
oLegend | The legend for this chart |
iNumSpecies | Number of species, total. |
jPreferredSize | Chart's size. |
ModelException | if anything goes wrong with drawing the chart. |
|
static |
Makes an overlaid map.
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 |
|
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".
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. |
ModelException | passed through from calling methods; should never be thrown. |
|
staticprivate |
Creates a tree map and returns it in a ChartPanel.
oDataset | The data to make into a map. |
sXAxisLabel | The X axis label |
sYAxisLabel | The Y axis label |
start | Start coordinate of the X axis, in meters |
end | End coordinate of the X axis, in meters |
start2 | Start coordinate of the Y axis, in meters |
end2 | End coordinate of the Y axis, in meters |
dbhScaleFactor | The scale factor which controls how large trees appear |
minDbh | The minimum diameter of trees to display |
entireXAxisLength | Full length of the plot X axis, in meters, so trees can be rendered at the proper size. |
entireYAxisLength | Full length of the plot Y axis, in meters, so trees can be rendered at the proper size. |
p_oSpeciesColors | An array of the preferred color for each species. |
jPreferredSize | Chart's size. |
ModelException | if something goes wrong with the chart. |
|
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.
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. |
|
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.
oDataset | The new dataset. |
jFrame | The window in which to update the chart. |
oLegend | The legend for this chart. |
ModelException | Passing through underlying exceptions. |
|
static |
Updates a grid map with a fresh dataset.
oDataset | The new dataset. |
fMin | Minimum dataset value, to be displayed. |
fMax | Maximum dataset value, to be displayed. |
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. |
ModelException | Passing through underlying exceptions. |
|
static |
Updates a histogram with a fresh dataset.
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. |
ModelException | Passing through underlying exceptions. |
|
static |
Updates a histogram with a fresh dataset.
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. |
ModelException | Passing through underlying exceptions. |
|
static |
Updates a histogram with a fresh dataset.
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. |
ModelException | Passing through underlying exceptions. |
|
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.
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. |
ModelException | Passing through underlying exceptions. |
|
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.
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 |
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.
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 |
fEntireXAxisLength | Full length of the plot X axis, in meters, so trees can be rendered at the proper size. |
fEntireYAxisLength | Full length of the plot Y axis, in meters, so trees can be rendered at the proper size. |
ModelException | Passing through underlying exceptions. |
|
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.
oDataset | The new dataset. |
jParentPanel | The window in which to update the chart. |
p_oSpeciesColors | Colors for each species. |
fDbhScaleFactor | The scale factor which controls how large trees appear |
fMinDbh | The minimum DBH of trees to display |
fEntireXAxisLength | Full length of the plot X axis, in meters, so trees can be rendered at the proper size. |
fEntireYAxisLength | Full length of the plot Y axis, in meters, so trees can be rendered at the proper size. |
ModelException | Passing through underlying exceptions. |