diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroup.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroup.java new file mode 100644 index 0000000000000000000000000000000000000000..874dc6b42c06fbcd5210d62017fc0620adac451f --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroup.java @@ -0,0 +1,43 @@ +/* + * PlotGroup.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package nl.astron.lofar.sas.otb.util.plotter; + +import java.util.LinkedList; + +/** + * @version $Id$ + * @created May 24, 2006, 11:11 AM + * @author pompert + */ +public class PlotGroup{ + + private LinkedList<PlotSlot> itsPlotSlots; + private PlotGroupConfiguration itsGroupConfiguration; + private String plotGroupName; + + /** Creates a new instance of PlotGroup */ + public PlotGroup() { + } + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupConfiguration.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..3600e70556d16a352fc1b62069966e92900ca53e --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupConfiguration.java @@ -0,0 +1,44 @@ +/* + * PlotGroupConfiguration.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package nl.astron.lofar.sas.otb.util.plotter; + +/** + * @version $Id$ + * @created May 24, 2006, 11:25 AM + * @author pompert + */ +public class PlotGroupConfiguration{ + + private double xstart; + private double xend; + private double ystart; + private double yend; + private int numx; + private int numy; + + /** Creates a new instance of PlotGroupConfiguration */ + public PlotGroupConfiguration() { + } + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupManager.java new file mode 100644 index 0000000000000000000000000000000000000000..de05a5daf6183940d69f4b71b8137084dbe76ede --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotGroupManager.java @@ -0,0 +1,42 @@ +/* + * PlotGroupManager.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package nl.astron.lofar.sas.otb.util.plotter; + +import java.util.HashMap; + +/** + * @version $Id$ + * @created May 24, 2006, 11:12 AM + * @author pompert + */ +public class PlotGroupManager{ + + private HashMap<String,PlotGroup> itsPlotGroups; + private HashMap<String,PlotGroupConfiguration> itsPlotGroupConfigs; + + /** Creates a new instance of PlotGroupManager */ + public PlotGroupManager() { + } + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java new file mode 100644 index 0000000000000000000000000000000000000000..b221dff81cf75947649647019788d5b210e1779c --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlot.java @@ -0,0 +1,130 @@ +/* + * PlotSlot.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package nl.astron.lofar.sas.otb.util.plotter; + +import java.awt.BorderLayout; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import nl.astron.lofar.java.gui.plotter.PlotConstants; +import nl.astron.lofar.java.gui.plotter.PlotPanel; +import nl.astron.lofar.java.gui.plotter.exceptions.PlotterException; + +/** + * @version $Id$ + * @created May 24, 2006, 11:12 AM + * @author pompert + */ +public class PlotSlot extends JPanel{ + + private PlotGroup itsPlotGroup; + private PlotPanel itsPlot; + private String slotLabel; + + /** Creates a new instance of PlotSlot */ + public PlotSlot() { + itsPlotGroup = null; + itsPlot = new PlotPanel(); + slotLabel = "Default Slot"; + setLayout(new BorderLayout()); + } + /** + * Creates a new instance of PlotSlot using a supplied label + * @param name The name to be given to the slot. + * + */ + public PlotSlot(String label) { + this(); + slotLabel = label; + } + + public void setLabel(String label){ + slotLabel = label; + } + + public String getLabel(){ + return slotLabel; + } + + public PlotPanel getPlot(){ + return itsPlot; + } + + public void addPlot(Object constraints){ + removeAll(); + try { + itsPlot.createPlot(PlotConstants.PLOT_XYLINE,true,constraints); + add(itsPlot,BorderLayout.CENTER); + } catch (PlotterException ex) { + JTextArea error = new JTextArea(ex.getMessage()); + error.setColumns(50); + add(new JTextArea(ex.getMessage()),BorderLayout.CENTER); + ex.printStackTrace(); + } + } + + public void modifyPlot(Object constraints){ + if(containsPlot()){ + + try { + itsPlot.modifyPlot(constraints); + add(itsPlot,BorderLayout.CENTER); + } catch (PlotterException ex) { + JTextArea error = new JTextArea(ex.getMessage()); + error.setColumns(50); + add(new JTextArea(ex.getMessage()),BorderLayout.CENTER); + ex.printStackTrace(); + } + + } + } + + public void removePlot(){ + if(containsPlot()){ + this.remove(itsPlot); + } + itsPlot = null; + } + + public boolean containsPlot(){ + return itsPlot != null; + } + + public PlotGroup getPlotGroup(){ + return itsPlotGroup; + } + + public void setPlotGroup(PlotGroup aPlotGroup){ + itsPlotGroup = aPlotGroup; + } + + public void removePlotGroup(){ + itsPlotGroup = null; + } + + public boolean hasPlotGroup(){ + return itsPlotGroup != null; + } + + +} diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java new file mode 100644 index 0000000000000000000000000000000000000000..078b15a600b3c723cf99c89f77897ab90a5a299d --- /dev/null +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/plotter/PlotSlotManager.java @@ -0,0 +1,42 @@ +/* + * PlotSlotManager.java + * + * Copyright (C) 2002-2007 + * ASTRON (Netherlands Foundation for Research in Astronomy) + * P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package nl.astron.lofar.sas.otb.util.plotter; + +import java.util.HashMap; + +/** + * @version $Id$ + * @created May 24, 2006, 11:12 AM + * @author pompert + */ +public class PlotSlotManager{ + + private int[] amountOfSlots; + private HashMap<int[],PlotSlot> itsPlotSlots; + + /** Creates a new instance of PlotSlotManager */ + public PlotSlotManager() { + } + +}