JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / analysis / AlignmentSorter.java
index e9eee16..8634db6 100755 (executable)
@@ -22,7 +22,8 @@ package jalview.analysis;
 
 import jalview.analysis.scoremodels.PIDModel;
 import jalview.analysis.scoremodels.SimilarityParams;
-import jalview.bin.Instance;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentOrder;
@@ -52,7 +53,7 @@ import java.util.List;
  * from the first tobesorted position in the alignment. e.g. (a,tb2,b,tb1,c,tb3
  * becomes a,tb1,tb2,tb3,b,c)
  */
-public class AlignmentSorter
+public class AlignmentSorter implements ApplicationSingletonI
 {
 
   private AlignmentSorter()
@@ -62,10 +63,8 @@ public class AlignmentSorter
 
   private static AlignmentSorter getInstance()
   {
-    Instance j = Instance.getInstance();
-    return (j.alignmentSorter == null
-            ? j.alignmentSorter = new AlignmentSorter()
-            : j.alignmentSorter);
+    return (AlignmentSorter) ApplicationSingletonProvider
+            .getInstance(AlignmentSorter.class);
   }
 
   /**