Merge branch 'develop' into features/JAL-2295setChimeraAttributes
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index da52940..c8708bd 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -391,7 +391,7 @@ public class StructureSelectionManager
         registerPDBFile(pdb.getId().trim(), pdbFile);
       }
       // if PDBId is unavailable then skip SIFTS mapping execution path
-      isMapUsingSIFTs = pdb.isPPDBIdAvailable();
+      isMapUsingSIFTs = isMapUsingSIFTs && pdb.isPPDBIdAvailable();
 
     } catch (Exception ex)
     {
@@ -805,6 +805,27 @@ public class StructureSelectionManager
       return;
     }
 
+    SearchResults results = findAlignmentPositionsForStructurePositions(atoms);
+    for (Object li : listeners)
+    {
+      if (li instanceof SequenceListener)
+      {
+        ((SequenceListener) li).highlightSequence(results);
+      }
+    }
+  }
+
+  /**
+   * Constructs a SearchResults object holding regions (if any) in the Jalview
+   * alignment which have a mapping to the structure viewer positions in the
+   * supplied list
+   * 
+   * @param atoms
+   * @return
+   */
+  public SearchResults findAlignmentPositionsForStructurePositions(
+          List<AtomSpec> atoms)
+  {
     SearchResults results = new SearchResults();
     for (AtomSpec atom : atoms)
     {
@@ -830,13 +851,7 @@ public class StructureSelectionManager
         }
       }
     }
-    for (Object li : listeners)
-    {
-      if (li instanceof SequenceListener)
-      {
-        ((SequenceListener) li).highlightSequence(results);
-      }
-    }
+    return results;
   }
 
   /**