X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=27ff242baacf2dc2b668a8b28ae5c17bc864d581;hb=7d8f40032746ee633dd980d5609c4d517a40421a;hp=cad230318200e4e246c3dceaf83ccfcc3235c255;hpb=e2a10c75f503d3f7e41c0de64e4c1e8ce8759cc9;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index cad2303..27ff242 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -31,6 +31,7 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; +import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceI; import jalview.ext.jmol.JmolParser; import jalview.gui.IProgressIndicator; @@ -805,6 +806,27 @@ public class StructureSelectionManager return; } + SearchResultsI 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 atoms) + { SearchResults results = new SearchResults(); for (AtomSpec atom : atoms) { @@ -830,13 +852,7 @@ public class StructureSelectionManager } } } - for (Object li : listeners) - { - if (li instanceof SequenceListener) - { - ((SequenceListener) li).highlightSequence(results); - } - } + return results; } /** @@ -855,7 +871,7 @@ public class StructureSelectionManager { boolean hasSequenceListeners = handlingVamsasMo || !seqmappings.isEmpty(); - SearchResults results = null; + SearchResultsI results = null; if (seqPos == -1) { seqPos = seq.findPosition(indexpos);