nl.astron.lofar.java.gui.plotter
Class PlotDataManager

java.lang.Object
  extended by nl.astron.lofar.java.gui.plotter.PlotDataManager

public class PlotDataManager
extends java.lang.Object

This singleton class functions as the gateway between the plotter and configured data access and export classes. Its function is to instantiate these classes and make sure that calls are redirected to them. It also loads the plotter_config.properties file and makes it available to other classes.

Version:
$Id$
Author:
pompert

Method Summary
 void exportData(java.lang.Object exportParams, java.util.HashMap data)
          This method exports a Plotter compliant dataset using the parameters provided.
 void finalize()
          Cleans up the data access/export interfaces and other instance variables
static PlotDataManager getInstance()
          Gets the static instance of PlotDataManager.
static java.util.ResourceBundle getPlotterConfigurationFile()
          Retrieves the bundle of strings in the plotter_config.properties file.
 java.util.HashMap retrieveData(java.lang.Object constraints)
          This method makes a Plotter compliant dataset using the constraints provided by the PlotPanel.
 java.util.HashMap updateData(java.util.HashMap currentData, java.lang.Object constraints)
          This method updates a Plotter compliant dataset using the current dataset and new constraints provided by the PlotPanel.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PlotDataManager getInstance()
Gets the static instance of PlotDataManager. If it does not yet exist, it will be created using the constructor.

Returns:
the PlotDataManager instance

finalize

public void finalize()
              throws java.lang.Throwable
Cleans up the data access/export interfaces and other instance variables

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

retrieveData

public java.util.HashMap retrieveData(java.lang.Object constraints)
                               throws PlotterException
This method makes a Plotter compliant dataset using the constraints provided by the PlotPanel. It will call the Data Access class provided in the plotter_config.properties file.

Parameters:
constraints - The String array containing constraints for the data access class
Returns:
the data set generated
Throws:
PlotterException - will be thrown when an Exception occurs inside the Data Access class, or when the Data Access class itself could not be properly accessed due to errors in the plotter_config.properties file.

updateData

public java.util.HashMap updateData(java.util.HashMap currentData,
                                    java.lang.Object constraints)
                             throws PlotterException
This method updates a Plotter compliant dataset using the current dataset and new constraints provided by the PlotPanel. It will call the Data Access class provided in the plotter_config.properties file.

Parameters:
currentData - The current dataset
constraints - The String array containing update constraints for the data access class
Returns:
the data set generated
Throws:
PlotterException - will be thrown when an Exception occurs inside the Data Access class, or when the Data Access class itself could not be properly accessed due to errors in the plotter_config.properties file.

exportData

public void exportData(java.lang.Object exportParams,
                       java.util.HashMap data)
                throws PlotterException
This method exports a Plotter compliant dataset using the parameters provided. It will call the Data Export class provided in the plotter_config.properties file.

Parameters:
exportParams - An object containing parameters for the data export class.
data - the data set to be exported
Throws:
PlotterException - will be thrown when an Exception occurs inside the Data Export class, or when the Data Export class itself could not be properly accessed due to errors in the plotter_config.properties file.

getPlotterConfigurationFile

public static java.util.ResourceBundle getPlotterConfigurationFile()
                                                            throws PlotterConfigurationNotFoundException
Retrieves the bundle of strings in the plotter_config.properties file. This method is static so other classes can retrieve it , which means that the properties file can be modified or extended for custom use. Important: The location where this method looks for is defined in the variable PlotConstants.RESOURCE_FILE

Returns:
The ResourceBundle of properties present in the plotter_config.properties file
Throws:
PlotterConfigurationNotFoundException - will be thrown if the file could not be located or loaded.
See Also:
PlotConstants