SORTIE Java Interface
1
|
This class takes care of managing data visualization. More...
Public Member Functions | |
DataVisualizerManager (MainWindow oMain, JDesktopPane jDesktop, JScrollPane jScroller) | |
Constructor. More... | |
DataFileManager | getDataManagerForFile (String sFile) |
Gets the data manager in charge of visualization for an output file. More... | |
void | drawChart (String sFile, String sChartChoice, ChartFrameInfo oInfo) throws ModelException |
Draws a chart on the desktop. More... | |
void | closeFile (String sFileName) throws ModelException |
Closes a detailed output file. More... | |
void | cleanUp () throws ModelException |
Causes all objects under management to perform any cleanup operations. More... | |
void | addFile (String sFileName) throws ModelException |
Notifies this object of a new output file. More... | |
void | addCurrentRunFile (String sFileName) throws ModelException |
Notifies this object of a new output file for the current run. More... | |
boolean | areCurrentRunChartsOpen () |
Tells whether there are any charts open for the current run (for real-time data visualization). More... | |
void | updateCurrentRunCharts () throws ModelException |
Updates any charts open for the current run. More... | |
void | closeCurrentRunCharts (MainWindow oWindow) |
Closes all charts associated with the current run. More... | |
JPopupMenu | getLineGraphOptionsForFile (String sFileName, ActionListener sActionListener) throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box. More... | |
JPopupMenu | getHistogramOptionsForFile (String sFileName, ActionListener sActionListener) throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box. More... | |
JPopupMenu | getTableOptionsForFile (String sFileName, ActionListener sActionListener) throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box. More... | |
JPopupMenu | getMapOptionsForFile (String sFileName, ActionListener sActionListener) throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box. More... | |
int | getModelState () |
Gets the current window state. More... | |
Private Member Functions | |
DataFileManager | makeDataManager (String sFileName) throws ModelException |
Creates a new data manager. More... | |
Private Attributes | |
int | m_iNumOpenPositions = 0 |
The number of positions available in which to put a newly opened window. More... | |
This class takes care of managing data visualization.
It keeps track of open files and causes their data windows to be placed on the main application window.
A current run may be opened for visualization as well. These files will be kept track of separately and updated on command.
When a new window is opened, if it is the first window open, it is placed at the upper right of the screen, just to the right of its legend, which is in the upper right corner. When the next window is opened, if a window is already in that position, it opens itself 20 pixels down and to the left. Subsequent windows open themselves 20 pixels down and to the left until the middle of the screen is reached, at which point the cycle returns to the upper right. If a window is opened and then moved, the next window open will grab its former spot.
Copyright: Copyright (c) Charles D. Canham 2012 Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
sortie.datavisualizer.DataVisualizerManager.DataVisualizerManager | ( | MainWindow | oMain, |
JDesktopPane | jDesktop, | ||
JScrollPane | jScroller | ||
) |
Constructor.
oMain | Main window. |
jDesktop | Desktop pane. |
jScroller | Scroll pane enclosing jDesktop. |
void sortie.datavisualizer.DataVisualizerManager.addCurrentRunFile | ( | String | sFileName | ) | throws ModelException |
Notifies this object of a new output file for the current run.
This file is subject to continuous updating.
sFileName | The filename. |
ModelException | if this is not a recognized output file. |
void sortie.datavisualizer.DataVisualizerManager.addFile | ( | String | sFileName | ) | throws ModelException |
Notifies this object of a new output file.
This should be a file not being generated by the current run.
sFileName | The filename. |
ModelException | if this is not a recognized output file. |
boolean sortie.datavisualizer.DataVisualizerManager.areCurrentRunChartsOpen | ( | ) |
Tells whether there are any charts open for the current run (for real-time data visualization).
void sortie.datavisualizer.DataVisualizerManager.cleanUp | ( | ) | throws ModelException |
Causes all objects under management to perform any cleanup operations.
Each should have its own CleanUp function; this will be called for each.
void sortie.datavisualizer.DataVisualizerManager.closeCurrentRunCharts | ( | MainWindow | oWindow | ) |
Closes all charts associated with the current run.
oWindow | Window so we can tell it to get rid of the file names from its options window |
void sortie.datavisualizer.DataVisualizerManager.closeFile | ( | String | sFileName | ) | throws ModelException |
Closes a detailed output file.
If the file doesn't match any files under management, nothing happens.
sFileName | File to close. |
void sortie.datavisualizer.DataVisualizerManager.drawChart | ( | String | sFile, |
String | sChartChoice, | ||
ChartFrameInfo | oInfo | ||
) | throws ModelException |
Draws a chart on the desktop.
sFile | The filename from which to draw the chart. |
sChartChoice | The chart to draw on the desktop. |
oInfo | Chart frame info. |
ModelException | If the filename is not valid, or the chart choice cannot be drawn, or wrapping another error. |
DataFileManager sortie.datavisualizer.DataVisualizerManager.getDataManagerForFile | ( | String | sFile | ) |
Gets the data manager in charge of visualization for an output file.
sFile | File for which to find the data manager. |
JPopupMenu sortie.datavisualizer.DataVisualizerManager.getHistogramOptionsForFile | ( | String | sFileName, |
ActionListener | sActionListener | ||
) | throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box.
sFileName | The filename. |
sActionListener | Action listener that will respond to graphs. |
ModelException | if the file cannot be found. |
JPopupMenu sortie.datavisualizer.DataVisualizerManager.getLineGraphOptionsForFile | ( | String | sFileName, |
ActionListener | sActionListener | ||
) | throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box.
sFileName | The filename. |
sActionListener | Action listener that will respond to graphs. |
ModelException | if the file cannot be found. |
JPopupMenu sortie.datavisualizer.DataVisualizerManager.getMapOptionsForFile | ( | String | sFileName, |
ActionListener | sActionListener | ||
) | throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box.
sFileName | The filename. |
sActionListener | Action listener that will respond to graphs. |
ModelException | if the file cannot be found. |
int sortie.datavisualizer.DataVisualizerManager.getModelState | ( | ) |
Gets the current window state.
JPopupMenu sortie.datavisualizer.DataVisualizerManager.getTableOptionsForFile | ( | String | sFileName, |
ActionListener | sActionListener | ||
) | throws ModelException |
Gets the list of chart options for an output file, ready to display in a combo box.
sFileName | The filename. |
sActionListener | Action listener that will respond to graphs. |
ModelException | if the file cannot be found. |
|
private |
Creates a new data manager.
This checks for the prior existence of a manager for the given file; if it already exists, the user is warned and nothing is done.
sFileName | String The file name for which to create a new file manager |
ModelException | if the file type is not recognized, or if there is a problem creating the manager. |
void sortie.datavisualizer.DataVisualizerManager.updateCurrentRunCharts | ( | ) | throws ModelException |
Updates any charts open for the current run.
If there are no open charts for the current run, this does nothing. This allows the file managers to decide how best to handle this, but the expectation is that they will display the most recent available data.
ModelException | if there is a problem drawing the charts. |
|
private |
The number of positions available in which to put a newly opened window.