From b99d899c86edf493c6e00b4283275e47b0a1a434 Mon Sep 17 00:00:00 2001 From: Arthur Coolen <coolen@astron.nl> Date: Mon, 5 Nov 2012 10:03:15 +0000 Subject: [PATCH] Task #3311: solved error in ParSetMetaViewPanel, no mouseclick trigger. --- .../lofar/sas/otb/util/ConfigPanelHelper.java | 44 +++++++++---------- .../otbcomponents/ParSetMetaViewPanel.java | 25 ++++++----- SAS/OTB/pom.xml | 2 +- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java index fb1f3b57a92..37893421489 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otb/util/ConfigPanelHelper.java @@ -40,75 +40,75 @@ import java.util.Set; * */ public class ConfigPanelHelper { - + private HashMap<String,ArrayList<String> > itsPanelMap; private ArrayList<String> itsArrayList; private static ConfigPanelHelper ref; - + /** Creates a new instance of ConfigPanelHelper */ private ConfigPanelHelper() { initMap(); } - + public static synchronized ConfigPanelHelper getConfigPanelHelper() { if (ref== null) { ref = new ConfigPanelHelper(); } return ref; } - + @Override public Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException(); } - + private void initMap() { itsPanelMap = new HashMap<>(); - + //generic panels itsArrayList = new ArrayList<>(); addBasePanels(); itsPanelMap.put("*",itsArrayList); - + //BBS - // itsVector = new Vector<String>(); - // itsVector.add("nl.astron.lofar.sas.otbcomponents.bbs.BBSPanel"); + // itsArrayList = new ArrayList<>(); + // itsArrayList.add("nl.astron.lofar.sas.otbcomponents.bbs.BBSPanel"); // itsPanelMap.put("BBSControl",itsVector); // addParSetPanel(); - + //BBS Strategy -// itsVector = new Vector<String>(); -// itsVector.add("nl.astron.lofar.sas.otbcomponents.bbs.BBSStrategyPanel"); +// itsArrayList = new ArrayList<>(); +// itsArrayList.add("nl.astron.lofar.sas.otbcomponents.bbs.BBSStrategyPanel"); // itsPanelMap.put("Strategy",itsVector); // addParSetPanel(); - + //OLAP itsArrayList = new ArrayList<>(); itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.OlapPanel"); itsPanelMap.put("OLAP",itsArrayList); addParSetPanel(); - + // Observation itsArrayList = new ArrayList<>(); itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ObservationPanel"); itsPanelMap.put("Observation",itsArrayList); addParSetPanel(); - + //TBB itsArrayList = new ArrayList<>(); itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.TBBConfigPanel"); itsPanelMap.put("TBB",itsArrayList); addParSetPanel(); - + //Imager itsArrayList = new ArrayList<>(); itsArrayList.add("nl.astron.lofar.sas.otbcomponents.userpanels.ImagerPanel"); itsPanelMap.put("Imager",itsArrayList); addParSetPanel(); } - - + + private void addBasePanels() { //generic node panel itsArrayList.add("nl.astron.lofar.sas.otbcomponents.NodeViewPanel"); @@ -116,7 +116,7 @@ public class ConfigPanelHelper { itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParameterViewPanel"); addParSetPanel(); } - + private void addParSetPanel() { //generic parset view panel itsArrayList.add("nl.astron.lofar.sas.otbcomponents.ParSetViewPanel"); @@ -145,7 +145,7 @@ public class ConfigPanelHelper { } return returnVector; } - + /** * Returns all keys kept in this class * @@ -174,6 +174,6 @@ public class ConfigPanelHelper { } return returnBool; } - - + + } diff --git a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetMetaViewPanel.java b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetMetaViewPanel.java index 27b235235c7..badd9d073f8 100644 --- a/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetMetaViewPanel.java +++ b/SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/ParSetMetaViewPanel.java @@ -472,20 +472,21 @@ public class ParSetMetaViewPanel extends javax.swing.JPanel implements IViewPane }//GEN-LAST:event_jScrollPane1MouseClicked private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked - String aS= (String)jTable1.getModel().getValueAt(jTable1.getSelectedRow(), 1); - String newS = ""; - // add newlines per 80 chars to be able to have a smaller sized popupwindow - for (int i=0; i< aS.length();i++) { - newS=newS.concat(aS.substring(i, i+1)); - if ((i+1)%80==0) { - newS=newS.concat("\n"); + if (jTable1.getSelectedRow() == -1) return; + String aS= (String)jTable1.getModel().getValueAt(jTable1.getSelectedRow(), 1); + String newS = ""; + // add newlines per 80 chars to be able to have a smaller sized popupwindow + for (int i=0; i< aS.length();i++) { + newS=newS.concat(aS.substring(i, i+1)); + if ((i+1)%80==0) { + newS=newS.concat("\n"); + } } - } - //popup the result - JOptionPane.showMessageDialog(this,newS, - "Show full row value", - JOptionPane.INFORMATION_MESSAGE); + //popup the result + JOptionPane.showMessageDialog(this,newS, + "Show full row value", + JOptionPane.INFORMATION_MESSAGE); }//GEN-LAST:event_jTable1MouseClicked private jOTDBnode itsNode = null; diff --git a/SAS/OTB/pom.xml b/SAS/OTB/pom.xml index 931bdccf5af..1bd376b0c51 100644 --- a/SAS/OTB/pom.xml +++ b/SAS/OTB/pom.xml @@ -22,7 +22,7 @@ <!-- Properties that can be used throughout the POM as a substitution, and are used as filters in resources if enabled. --> <properties> - <lofar.lib.version>1.8.1</lofar.lib.version> + <lofar.lib.version>1.8.2-SNAPSHOT</lofar.lib.version> </properties> -- GitLab