JAL-1544 spelling
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 9dd730c..4359877 100644 (file)
@@ -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<AlignedCodonFrame> seqmappings = new LinkedHashSet<AlignedCodonFrame>();
+  public Set<AlignedCodonFrame> seqmappings = new LinkedHashSet<AlignedCodonFrame>();
 
   private List<CommandListener> commandListeners = new ArrayList<CommandListener>();
 
@@ -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<AlignedCodonFrame> 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