JAL-3253 preliminary static fixes for JavaScript part 3 of 3
[jalview.git] / src / jalview / io / gff / SequenceOntologyFactory.java
index 90cae7a..cd5a22c 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.io.gff;
 
+import jalview.bin.Jalview;
+
 /**
  * A factory class that returns a model of the Sequence Ontology. By default a
  * hard-coded subset is used (for the applet, or testing), or setInstance() can
@@ -30,19 +32,21 @@ package jalview.io.gff;
  */
 public class SequenceOntologyFactory
 {
-  private static SequenceOntologyI instance;
+  // private static SequenceOntologyI instance; // moved to Jalview.instance for
+  // JavaScript
 
   public static synchronized SequenceOntologyI getInstance()
   {
-    if (instance == null)
+    Jalview j = Jalview.getInstance();
+    if (j.sequenceOntology == null)
     {
-      instance = new SequenceOntologyLite();
+      j.sequenceOntology = new SequenceOntologyLite();
     }
-    return instance;
+    return j.sequenceOntology;
   }
 
   public static void setInstance(SequenceOntologyI so)
   {
-    instance = so;
+    Jalview.getInstance().sequenceOntology = so;
   }
 }