JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / ws / sifts / SiftsSettings.java
index 31274d9..88aaed4 100644 (file)
  */
 package jalview.ws.sifts;
 
-import jalview.bin.Jalview;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
 
 import java.util.Objects;
 
-public class SiftsSettings
+public class SiftsSettings implements ApplicationSingletonI
 {
+
+  /**
+   * public only for testng
+   * 
+   * @return
+   */
+  public static SiftsSettings getInstance()
+  {
+    return (SiftsSettings) ApplicationSingletonProvider
+            .getInstance(SiftsSettings.class);
+  }
+
+  private SiftsSettings()
+  {
+    // singleton; use getInstance()
+  }
+
   private boolean mapWithSifts = false;
 
   private String siftDownloadDirectory;
@@ -34,16 +52,6 @@ public class SiftsSettings
 
   private int failSafePIDThreshold;
 
-  private static SiftsSettings getInstance()
-  {
-    {
-      Jalview j = Jalview.getInstance();
-      return (j.siftsSettings == null
-              ? j.siftsSettings = new SiftsSettings()
-              : j.siftsSettings);
-    }
-
-  }
   public static boolean isMapWithSifts()
   {
     return getInstance().mapWithSifts;