JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / analysis / scoremodels / ScoreModels.java
index 7431b86..8700ec0 100644 (file)
@@ -22,7 +22,8 @@ package jalview.analysis.scoremodels;
 
 import jalview.api.AlignmentViewPanel;
 import jalview.api.analysis.ScoreModelI;
-import jalview.bin.Instance;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
 import jalview.io.DataSourceType;
 import jalview.io.FileParse;
 import jalview.io.ScoreMatrixFile;
@@ -34,7 +35,7 @@ import java.util.Map;
 /**
  * A class that can register and serve instances of ScoreModelI
  */
-public class ScoreModels
+public class ScoreModels implements ApplicationSingletonI
 {
   /**
    * Answers the singleton instance of this class, with lazy initialisation
@@ -44,9 +45,7 @@ public class ScoreModels
    */
   public static ScoreModels getInstance()
   {
-    Instance j = Instance.getInstance();
-    return (j.scoreModels == null ? j.scoreModels = new ScoreModels()
-            : j.scoreModels);
+    return (ScoreModels) ApplicationSingletonProvider.getInstance(ScoreModels.class);
   }
 
   /**
@@ -150,7 +149,7 @@ public class ScoreModels
    */
   public void reset()
   {
-    Instance.getInstance().scoreModels = new ScoreModels();
+    ApplicationSingletonProvider.removeInstance(this.getClass());
   }
 
   /**