JAL-3253 jalview.bin.Instance streamlining
[jalview.git] / src / jalview / project / Jalview2XML.java
index 7f550ee..e293831 100644 (file)
@@ -34,7 +34,6 @@ import jalview.api.analysis.ScoreModelI;
 import jalview.api.analysis.SimilarityParamsI;
 import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
-import jalview.bin.Instance;
 import jalview.datamodel.AlignedCodonFrame;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
@@ -83,7 +82,6 @@ import jalview.schemes.ColourSchemeProperty;
 import jalview.schemes.FeatureColour;
 import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
-import jalview.structure.StructureSelectionManager;
 import jalview.structures.models.AAStructureBindingModel;
 import jalview.util.Format;
 import jalview.util.MessageManager;
@@ -2380,7 +2378,7 @@ public class Jalview2XML
     if (calcIdParam.getVersion().equals("1.0"))
     {
       final String[] calcIds = calcIdParam.getServiceURL().toArray(new String[0]);
-      Jws2Instance service = Jws2Discoverer.getDiscoverer()
+      Jws2Instance service = Jws2Discoverer.getInstance()
               .getPreferredServiceFor(calcIds);
       if (service != null)
       {
@@ -2916,9 +2914,9 @@ public class Jalview2XML
       {
         // used to attempt to parse as V1 castor-generated xml
       }
-      if (Instance.getDesktop() != null)
+      if (Desktop.getInstance() != null)
       {
-        Instance.getDesktop().stopLoading();
+        Desktop.getInstance().stopLoading();
       }
       if (af != null)
       {
@@ -2946,7 +2944,7 @@ public class Jalview2XML
      */
     for (AlignFrame fr : gatherToThisFrame.values())
     {
-      Instance.getDesktop().gatherViews(fr);
+      Desktop.getInstance().gatherViews(fr);
     }
 
     restoreSplitFrames();
@@ -2954,8 +2952,7 @@ public class Jalview2XML
     {
       if (ds.getCodonFrames() != null)
       {
-        StructureSelectionManager
-                .getStructureSelectionManager(Instance.getDesktop())
+        Desktop.getStructureSelectionManager()
                 .registerMappings(ds.getCodonFrames());
       }
     }
@@ -2964,9 +2961,9 @@ public class Jalview2XML
       reportErrors();
     }
 
-    if (Instance.getDesktop() != null)
+    if (Desktop.getInstance() != null)
     {
-      Instance.getDesktop().stopLoading();
+      Desktop.getInstance().stopLoading();
     }
 
     return af;
@@ -3047,7 +3044,7 @@ public class Jalview2XML
      */
     for (SplitFrame sf : gatherTo)
     {
-      Instance.getDesktop().gatherViews(sf);
+      Desktop.getInstance().gatherViews(sf);
     }
 
     splitFrameCandidates.clear();
@@ -3576,9 +3573,7 @@ public class Jalview2XML
             {
               entry.setProperty(prop.getName(), prop.getValue());
             }
-            StructureSelectionManager
-                    .getStructureSelectionManager(Instance.getDesktop())
-                    .registerPDBEntry(entry);
+            Desktop.getStructureSelectionManager().registerPDBEntry(entry);
             // adds PDBEntry to datasequence's set (since Jalview 2.10)
             if (al.getSequenceAt(i).getDatasetSequence() != null)
             {