JAL-3446 reorganized JalviewJSApp (accidentally put that in jalview/api)
[jalview.git] / src / jalview / bin / Jalview.java
index 4819d7a..81193e6 100755 (executable)
@@ -48,7 +48,6 @@ import com.threerings.getdown.util.LaunchUtil;
 import groovy.lang.Binding;
 import groovy.util.GroovyScriptEngine;
 import jalview.api.AlignCalcWorkerI;
-import jalview.api.JalviewJSApp;
 import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
 import jalview.ext.so.SequenceOntology;
 import jalview.gui.AlignFrame;
@@ -388,8 +387,6 @@ public class Jalview implements ApplicationSingletonI
       System.exit(0);
     }
 
-    desktop = null;
-
     if (!isJS)
     /** @j2sIgnore */
     {
@@ -450,6 +447,8 @@ public class Jalview implements ApplicationSingletonI
       SequenceOntologyFactory.setSequenceOntology(new SequenceOntology());
     }
 
+
+    desktop = null;
     if (!headless)
     {
       desktop = Desktop.getInstance();
@@ -581,7 +580,6 @@ public class Jalview implements ApplicationSingletonI
     FileLoader fileLoader = new FileLoader(!headless);
     FileFormatI format = null;
     // Finally, deal with the remaining input data.
-    JalviewJSApp jsApp = null;
     AlignFrame af = null;
 
     if (file != null)
@@ -822,8 +820,7 @@ public class Jalview implements ApplicationSingletonI
 
         if (isJS)
         {
-          jsApp = new JalviewJSApp(this, aparser);
-          jsApp.load(af);
+          new JalviewJSApp(this, aparser, af);
         }
         else
         /**
@@ -927,10 +924,6 @@ public class Jalview implements ApplicationSingletonI
       desktop.setInBatchMode(false);
     }
 
-    if (isJS && isStartup)
-    {
-      jsApp.callInitCallback();
-    }
   }