JAL-2110 random stuff
[jalview.git] / src / jalview / gui / AlignFrame.java
index aa07a93..477d113 100644 (file)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.AlignmentUtils;
 import jalview.analysis.CrossRef;
+import jalview.analysis.CrossRefs;
 import jalview.analysis.Dna;
 import jalview.analysis.ParseProperties;
 import jalview.analysis.SequenceIdMatcher;
@@ -4647,24 +4648,21 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       showProducts.removeAll();
       final boolean dna = viewport.getAlignment().isNucleotide();
-      String[] ptypes = (selection == null || selection.length == 0) ? null
-              : CrossRef.findSequenceXrefTypes(dna, selection, dataset);
+      List<String> ptypes = (selection == null || selection.length == 0) ? null
+              : CrossRef.findXrefSourcesForSequences(dna, selection, dataset);
 
-      for (int t = 0; ptypes != null && t < ptypes.length; t++)
+      for (final String source : ptypes)
       {
         showp = true;
         final AlignFrame af = this;
-        final String source = ptypes[t];
-        JMenuItem xtype = new JMenuItem(ptypes[t]);
+        JMenuItem xtype = new JMenuItem(source);
         xtype.addActionListener(new ActionListener()
         {
-
           @Override
           public void actionPerformed(ActionEvent e)
           {
             showProductsFor(af.viewport.getSequenceSelection(), dna, source);
           }
-
         });
         showProducts.add(xtype);
       }
@@ -4672,7 +4670,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       showProducts.setEnabled(showp);
     } catch (Exception e)
     {
-      jalview.bin.Cache.log
+      Cache.log
               .warn("canShowProducts threw an exception - please report to help@jalview.org",
                       e);
       return false;
@@ -4708,7 +4706,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         {
           AlignmentI alignment = AlignFrame.this.getViewport()
                   .getAlignment();
-          AlignmentI xrefs = CrossRef.findXrefSequences(sel, dna, source,
+          AlignmentI xrefs = CrossRefs.findXrefSequences(sel, dna, source,
                   alignment);
           if (xrefs != null)
           {