JAL-3253 jalview.bin.Instance streamlining
[jalview.git] / src / jalview / gui / AlignViewport.java
index ff3285c..ec940b6 100644 (file)
@@ -29,7 +29,6 @@ import jalview.api.FeatureSettingsModelI;
 import jalview.api.FeaturesDisplayedI;
 import jalview.api.ViewStyleI;
 import jalview.bin.Cache;
-import jalview.bin.Instance;
 import jalview.commands.CommandI;
 import jalview.datamodel.AlignedCodonFrame;
 import jalview.datamodel.Alignment;
@@ -384,9 +383,8 @@ public class AlignViewport extends AlignmentViewport
      */
     if (align != null)
     {
-      StructureSelectionManager ssm = StructureSelectionManager
-              .getStructureSelectionManager(Instance.getDesktop());
-      ssm.registerMappings(align.getCodonFrames());
+      Desktop.getStructureSelectionManager()
+              .registerMappings(align.getCodonFrames());
     }
 
     /*
@@ -406,8 +404,8 @@ public class AlignViewport extends AlignmentViewport
       List<AlignedCodonFrame> mappings = al.getCodonFrames();
       if (mappings != null)
       {
-        StructureSelectionManager ssm = StructureSelectionManager
-                .getStructureSelectionManager(Instance.getDesktop());
+        StructureSelectionManager ssm = Desktop
+                .getStructureSelectionManager();
         for (AlignedCodonFrame acf : mappings)
         {
           if (noReferencesTo(acf))
@@ -532,12 +530,10 @@ public class AlignViewport extends AlignmentViewport
   @Override
   public void sendSelection()
   {
-    jalview.structure.StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop())
-            .sendSelection(new SequenceGroup(getSelectionGroup()),
-                    new ColumnSelection(getColumnSelection()),
-                    new HiddenColumns(getAlignment().getHiddenColumns()),
-                    this);
+    Desktop.getStructureSelectionManager().sendSelection(
+            new SequenceGroup(getSelectionGroup()),
+            new ColumnSelection(getColumnSelection()),
+            new HiddenColumns(getAlignment().getHiddenColumns()), this);
   }
 
   /**
@@ -578,8 +574,7 @@ public class AlignViewport extends AlignmentViewport
   @Override
   public StructureSelectionManager getStructureSelectionManager()
   {
-    return StructureSelectionManager
-            .getStructureSelectionManager(Instance.getDesktop());
+    return Desktop.getStructureSelectionManager();
   }
 
   @Override