retrieve all sequences matching a particular name (JAL-872)
[jalview.git] / src / jalview / gui / AlignFrame.java
index b658ffb..06272c3 100755 (executable)
@@ -4513,7 +4513,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           if (pdbfn.length() > 0)
           {
             // attempt to find a match in the alignment
-            SequenceI mtch = idm.findIdMatch(pdbfn);
+            SequenceI[] mtch = idm.findAllIdMatches(pdbfn);
             int l = 0, c = pdbfn.indexOf(".");
             while (mtch == null && c != -1)
             {
@@ -4525,7 +4525,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               {
                 pdbfn = pdbfn.substring(0, l);
               }
-              mtch = idm.findIdMatch(pdbfn);
+              mtch = idm.findAllIdMatches(pdbfn);
             }
             if (mtch != null)
             {
@@ -4570,17 +4570,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               // try and associate
               // TODO: may want to set a standard ID naming formalism for
               // associating PDB files which have no IDs.
+              for (SequenceI toassoc: (SequenceI[])fm[2]) {
               PDBEntry pe = new AssociatePdbFileWithSeq()
                       .associatePdbWithSeq((String) fm[0], (String) fm[1],
-                              (SequenceI) fm[2], false);
+                              toassoc, false);
               if (pe != null)
               {
                 System.err
                         .println("Associated file : " + ((String) fm[0])
                                 + " with "
-                                + ((SequenceI) fm[2]).getDisplayId(true));
+                                + toassoc.getDisplayId(true));
                 assocfiles++;
               }
+              }
               alignPanel.paintAlignment(true);
             }
           }