Merge branch 'features/JAL-2944_openStructuresInSelectedView' of https://source.jalvi... features/JAL-2944_openStructuresInSelectedView
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 13 Apr 2018 07:21:00 +0000 (08:21 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 13 Apr 2018 07:21:00 +0000 (08:21 +0100)
1  2 
src/jalview/structure/StructureSelectionManager.java

@@@ -285,8 -285,7 +285,8 @@@ public class StructureSelectionManage
    }
  
    /**
 -   * Returns the file name for a mapped PDB id (or null if not mapped).
 +   * Returns the filename the PDB id is already mapped to if known, or null if
 +   * it is not mapped
     * 
     * @param pdbid
     * @return
    {
      for (StructureMapping sm : mappings)
      {
 -      if (sm.getPdbId().equals(pdbid))
 +      if (sm.getPdbId().equalsIgnoreCase(pdbid))
        {
          return sm.pdbfile;
        }
              {
                System.err.println(e.getMessage());
              }
+             catch (Exception e)
+             {
+               System.err
+                       .println(
+                               "Unexpected exception during SIFTS mapping - falling back to NW for this sequence/structure pair");
+               System.err.println(e.getMessage());
+             }
            }
            if (!foundSiftsMappings.isEmpty())
            {
        }
        if (forStructureView)
        {
 -        mappings.addAll(seqToStrucMapping);
 +        for (StructureMapping sm : seqToStrucMapping)
 +        {
 +          addStructureMapping(sm); // not addAll!
 +        }
        }
        if (progress != null)
        {
  
    public void addStructureMapping(StructureMapping sm)
    {
 -    mappings.add(sm);
 +    if (!mappings.contains(sm))
 +    {
 +      mappings.add(sm);
 +    }
    }
  
    /**