From 12d7195dddefff8e675f0d26ba71e76992e072ac Mon Sep 17 00:00:00 2001
From: pompert <sdos@astron.nl>
Date: Tue, 23 May 2006 14:21:30 +0000
Subject: [PATCH] BugID: 701 Additions: -None Mods: -Modified the
 retrieveData/exportData methods throughout the Plotter to accept an Object
 instead of a String[] to support passing on data sets etc. This is more
 practical than limiting this variable to a String[].

---
 .../lofar/java/gui/plotter/IPlotDataAccess.java  |  8 ++++----
 .../lofar/java/gui/plotter/IPlotDataExport.java  |  4 ++--
 .../lofar/java/gui/plotter/PlotController.java   | 10 +++++-----
 .../lofar/java/gui/plotter/PlotDataManager.java  |  8 ++++----
 .../astron/lofar/java/gui/plotter/PlotPanel.java | 16 ++++++++--------
 5 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataAccess.java b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataAccess.java
index 85d732f8dfe..a4e6ea748da 100644
--- a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataAccess.java
+++ b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataAccess.java
@@ -39,14 +39,14 @@ import nl.astron.lofar.java.gui.plotter.exceptions.PlotterDataAccessException;
 public interface IPlotDataAccess{
     
     /**
-     * This method will retrieve data from the data access layer using an array
-     * of strings and it must return a HashMap dataset understandable by the plotter. 
-     * @param constraints An array of String constraints to be passed to the implementing class
+     * This method will retrieve data from the data access layer using an object with any
+     * possible information and it must return a HashMap dataset understandable by the plotter. 
+     * @param constraints An object with constraints to be passed to the implementing class
      * @return The dataset that has been generated
      * @throws PlotterDataAccessException will be thrown if the dataset could not
      * be generated for any reason, like database exceptions, file errors, etc.
      */
-    public HashMap retrieveData(String[] constraints) throws PlotterDataAccessException;
+    public HashMap retrieveData(Object constraints) throws PlotterDataAccessException;
     
 }
 
diff --git a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataExport.java b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataExport.java
index 7bbad18f674..a840d5bee09 100644
--- a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataExport.java
+++ b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/IPlotDataExport.java
@@ -39,13 +39,13 @@ public interface IPlotDataExport{
     
     /**
      * Exports a dataset using a set of String parameters
-     * @param params String array containing zero or more arguments for the export class
+     * @param params Object containing zero or more arguments for the export class
      * @param data the dataset to be exported
      * @throws PlotterException will be thrown if the dataset could not
      * be exported for any reason, like database exceptions, file errors, etc. 
      * (This exception will be migrated to a more specific PlotterDataExportException)
      */
-    public void exportData(String[] params, HashMap data) throws PlotterException;
+    public void exportData(Object params, HashMap data) throws PlotterException;
     
 }
 
diff --git a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotController.java b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotController.java
index f6558fe259b..78152030ef7 100644
--- a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotController.java
+++ b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotController.java
@@ -84,7 +84,7 @@ public class PlotController{
          * layer or the Plotter Framework have run into an exception that the 
          * user needs to be aware of.
 	 */
-	public JComponent createPlot(int type, boolean separateLegend, String[] constraints) throws PlotterException{
+	public JComponent createPlot(int type, boolean separateLegend, Object constraints) throws PlotterException{
             String plotFrameworkClass = "";
             Object aPlotter = null;
             IPlot aNewPlot = null;
@@ -137,7 +137,7 @@ public class PlotController{
                         HashMap retrieveableData = 
                             m_PlotDataManager.retrieveData(constraints);                               
                         m_IPlot = aNewPlot;
-                        return m_IPlot.createPlot(type,constraints[0],retrieveableData,separateLegend);
+                        return m_IPlot.createPlot(type,constraints.toString(),retrieveableData,separateLegend);
                 
                 }else{
                     throw new NotSupportedException("The requested plot type ("+type+") is not supported by the plotter at this time.");
@@ -169,18 +169,18 @@ public class PlotController{
          * layer or the Plotter Framework have run into an exception that the 
          * user needs to be aware of.
 	 */
-	public Image createPlotImage(String[] constraints) throws PlotterException{
+	public Image createPlotImage(Object constraints) throws PlotterException{
             throw new NotImplementedException("Image exportation is not yet implemented in this release."); 
 	}
 
 	/**
          * This method will attempt to export a plot using the 
          * Data Export layer specified in the plotter_config.properties file.
-         * @param arguments The array of string arguments to be passed to the data export layer
+         * @param arguments The object containing arguments to be passed to the data export layer
 	 * @throws PlotterException will be thrown when the Data Export 
          * layer has run into an exception that the user needs to be aware of.
 	 */
-	public void exportData(String[] arguments) throws PlotterException{
+	public void exportData(Object arguments) throws PlotterException{
             throw new NotImplementedException("Export of data is not yet implemented in this release."); 
 	}
 
diff --git a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotDataManager.java b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotDataManager.java
index 3bdc74f39bf..561a5abdb0e 100644
--- a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotDataManager.java
+++ b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotDataManager.java
@@ -91,7 +91,7 @@ public class PlotDataManager{
      * 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.
      */
-    public HashMap retrieveData(String[] constraints) throws PlotterException{
+    public HashMap retrieveData(Object constraints) throws PlotterException{
         if(aDataAccessor == null){
             initializeDataAccessLayer();
         }        
@@ -110,14 +110,14 @@ public class PlotDataManager{
      * the parameters provided. It will call the Data Export 
      * class provided in the plotter_config.properties file.
      * 
-     * @param exportParams The String array containing parameters for the data 
-     * export class
+     * @param exportParams An object containing parameters for the data 
+     * export class.
      * @param 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.
      */
-    public void exportData(String[] exportParams, HashMap data) throws PlotterException{
+    public void exportData(Object exportParams, HashMap data) throws PlotterException{
         throw new NotImplementedException("Export of data is not yet implemented in this release.");
     }
     /**
diff --git a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotPanel.java b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotPanel.java
index 3a92353bff1..85ce85f0312 100644
--- a/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotPanel.java
+++ b/JAVA/GUI/Plotter/src/nl/astron/lofar/java/gui/plotter/PlotPanel.java
@@ -47,7 +47,7 @@ public class PlotPanel extends JPanel{
 	private PlotController m_PlotController;
         private JComponent plot;
         private JComponent legend;
-        private String[] currentDataConstraint;
+        private Object currentDataConstraint;
         
         /**
          * - Constructs a new PlotPanel
@@ -72,7 +72,7 @@ public class PlotPanel extends JPanel{
          * -int type (this is defined by PlotConstants.PLOT_*)
          * -boolean separateLegend (this will tell the plotter that you would like a separate JComponent legend,
          *                          otherwise you will see a legend where the plotter puts it by default.
-         * -String[] constraints (These are the arguments you need for the data access layer to get the data
+         * -Object constraints (These are the arguments you need for the data access layer to get the data
          *                        you want, which can be anything, as long as your configured data access layer
          *                        supports it!)
          * The plot will be added to this class' ContentPane so you can view it directly. It can also be retrieved separately
@@ -85,7 +85,7 @@ public class PlotPanel extends JPanel{
          * Please handle this exception in a way that your application does not suffer from it, and make sure the user will be shown a message
          * that something has gone wrong.
          */
-	public void createPlot(int type, boolean separateLegend, String[] constraints) throws PlotterException{
+	public void createPlot(int type, boolean separateLegend, Object constraints) throws PlotterException{
             this.removeAll();
             plot = null;
             legend = null;
@@ -96,7 +96,7 @@ public class PlotPanel extends JPanel{
         /**
          * This method will attempt to generate a plot image using several key arguments:
          * -int type (this is defined by PlotConstants.PLOT_*)
-         * -String[] constraints (These are the arguments you need for the data access layer to get the data
+         * -Object constraints (These are the arguments you need for the data access layer to get the data
          *                        you want, which can be anything, as long as your configured data access layer
          *                        supports it!)
          *                         
@@ -107,20 +107,20 @@ public class PlotPanel extends JPanel{
          * Please handle this exception in a way that your application does not suffer from it, and make sure the user will be shown a message
          * that something has gone wrong.
          */
-	public Image exportImage(int type, String[] constraints) throws PlotterException{
+	public Image exportImage(int type, Object constraints) throws PlotterException{
             return m_PlotController.createPlotImage(constraints);
 	}
         /**
          * This method will attempt to export the data currently in the plot to your configured data export layer using a single argument:
-         * -String[] arguments (These are the arguments you need for the data export layer to export the data
-         *                        you currently have in the plot, and these strings can mean anything, as long as your configured data export layer
+         * -Object arguments (These are the arguments you need for the data export layer to export the data
+         *                        you currently have in the plot, and this can be anything, as long as your configured data export layer
          *                        supports them!)
          * @param arguments The arguments to be passed to the configured data export layer
          * @throws PlotterException will be thrown if an Exception is detected in the plotter that the user needs to be aware of.
          * Please handle this exception in a way that your application does not suffer from it, and make sure the user will be shown a message
          * that something has gone wrong.
          */
-	public void exportData(String[] arguments) throws PlotterException{
+	public void exportData(Object arguments) throws PlotterException{
             m_PlotController.exportData(arguments);
         }
          /**
-- 
GitLab