package jalview.ext.ensembl;
+import jalview.bin.Jalview;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefSource;
public class EnsemblInfo extends EnsemblRestClient
{
- private static EnsemblInfo instance;
-
- /**
- * Some question as to whether it is necessary to do this for each applet. IN
- * PRINCIPLE, applets could set different properties for the origin of Ensembl
- * data. But I suggest this is unlikely. If we DO care about that possibility,
- * then we need to set doICare to Platform.isJS();
- *
- */
- private final static boolean doICare = false;// Platform.isJS();
-
/**
* On first request only, populate the lookup map by fetching the list of
* divisions known to EnsemblGenomes.
*/
private static EnsemblInfo getInstance()
{
-
- // BH 2019.05.08 need to isolate static fields in JavaScript
-
- EnsemblInfo i = instance;
- @SuppressWarnings("unused")
- ThreadGroup g = null;
-
- if (doICare)
- {
- g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative i = g._jalviewEnsemblInstance;
- *
- */
- }
- if (i == null)
- {
- i = new EnsemblInfo();
-
- if (doICare)
- {
- /**
- * @j2sNative g._jalviewEnsemblInstance = i;
- *
- */
- }
- else
- {
- instance = i;
- }
- }
- return i;
+ Jalview j = Jalview.getInstance();
+ return (j.ensemblInfo == null ? j.ensemblInfo = new EnsemblInfo()
+ : j.ensemblInfo);
}
/*