X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=43598774a8451a7431379e88470b813c1fcdc11f;hb=c6c94d2adb0d156345065b1a7e18e26c7b8dd2b8;hp=9dd730c223e7bf5ff02e29ba3adad69583ce1484;hpb=bd817b546aad8c7456fd5682a890eb79faeb5deb;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 9dd730c..4359877 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -21,7 +21,6 @@ package jalview.structure; import jalview.analysis.AlignSeq; -import jalview.api.AlignmentViewPanel; import jalview.api.StructureSelectionManagerProvider; import jalview.commands.CommandI; import jalview.commands.EditCommand; @@ -33,8 +32,6 @@ import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; import jalview.datamodel.SequenceI; -import jalview.gui.AlignFrame; -import jalview.gui.Desktop; import jalview.io.AppletFormatAdapter; import jalview.util.MappingUtils; import jalview.util.MessageManager; @@ -73,7 +70,7 @@ public class StructureSelectionManager /* * Set of any registered mappings between (dataset) sequences. */ - Set seqmappings = new LinkedHashSet(); + public Set seqmappings = new LinkedHashSet(); private List commandListeners = new ArrayList(); @@ -912,31 +909,13 @@ public class StructureSelectionManager } /** - * Deregister each mapping in the set, unless there is still an alignment that - * holds a reference to it. Note we do not update the set itself, as it may be - * shared with an alignment view which is still open. - * - * @param set - */ - public void deregisterMappings(Set set) - { - if (set != null) - { - for (AlignedCodonFrame acf : set) - { - deregisterMapping(acf); - } - } - } - - /** - * Remove the given mapping provided no alignment holds a reference to it + * Remove the given mapping * * @param acf */ public void deregisterMapping(AlignedCodonFrame acf) { - if (noReferencesTo(acf)) + if (acf != null) { boolean removed = seqmappings.remove(acf); if (removed && seqmappings.isEmpty()) @@ -947,33 +926,6 @@ public class StructureSelectionManager } /** - * Answers true if no alignment holds a reference to the given mapping - * - * @param acf - * @return - */ - protected boolean noReferencesTo(AlignedCodonFrame acf) - { - AlignFrame[] frames = Desktop.getAlignFrames(); - if (frames == null) - { - return true; - } - for (AlignFrame af : frames) - { - for (AlignmentViewPanel ap : af.getAlignPanels()) - { - AlignmentI al = ap.getAlignment(); - if (al != null && al.getCodonFrames().contains(acf)) - { - return false; - } - } - } - return true; - } - - /** * Add each of the given codonFrames to the stored set, if not aready present. * * @param set