JAL-1191 use full SO in desktop application
[jalview.git] / src / jalview / io / gff / SequenceOntologyFactory.java
1 package jalview.io.gff;
2
3 import jalview.bin.Cache;
4 import jalview.ext.so.SequenceOntology;
5
6 /**
7  * A factory class that returns a model of the Sequence Ontology. If the user's
8  * Jalview properties file has the line <br>
9  * USE_SO_LITE = true <br>
10  * then a hard-coded subset will be used, otherwise the full ontology (as
11  * downloaded at a point in time).
12  * 
13  * @author gmcarstairs
14  *
15  */
16 public class SequenceOntologyFactory
17 {
18   private static SequenceOntologyI instance;
19
20   public static synchronized SequenceOntologyI getInstance()
21   {
22     if (instance == null)
23     {
24       if (Cache.getDefault("USE_SO_LITE", false))
25       {
26         instance = new SequenceOntologyLite();
27       }
28       else
29       {
30         instance = new SequenceOntology();
31       }
32     }
33     return instance;
34   }
35
36   public static void setInstance(SequenceOntologyI so)
37   {
38     instance = so;
39   }
40 }