apply version 2.7 copyright
[jalview.git] / src / jalview / gui / PopupMenu.java
index ca6b199..da95ae0 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -391,6 +391,7 @@ public class PopupMenu extends JPopupMenu
       }
       // Add a 'show all structures' for the current selection
       Hashtable<String, PDBEntry> pdbe=new Hashtable<String,PDBEntry>();
+      SequenceI sqass=null;
       for (SequenceI sq: ap.av.getSequenceSelection())
       {
         Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence().getPDBId();
@@ -398,6 +399,10 @@ public class PopupMenu extends JPopupMenu
           for (PDBEntry pe: pes)
           {
             pdbe.put(pe.getId(),  pe);
+            if (sqass==null)
+            {
+              sqass = sq;
+            }
           }
         }
       }
@@ -405,7 +410,12 @@ public class PopupMenu extends JPopupMenu
       {
         final PDBEntry[] pe = pdbe.values().toArray(new PDBEntry[pdbe.size()]);
         final JMenuItem gpdbview;
-        structureMenu.add(gpdbview=new JMenuItem("View "+pdbe.size()+" structures."));
+        if (pdbe.size()==1)
+        {
+          structureMenu.add(gpdbview=new JMenuItem("View structure for "+sqass.getDisplayId(false)));
+        } else {
+          structureMenu.add(gpdbview=new JMenuItem("View all "+pdbe.size()+" structures."));
+        }
         gpdbview.setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
         gpdbview.addActionListener(new ActionListener()
         {