JAL-3848 add compbio and jalview to direct connection list for J2S
[jalview.git] / src / jalview / bin / Jalview.java
index 36b5ea3..1c7e4ea 100755 (executable)
@@ -186,8 +186,8 @@ public class Jalview implements ApplicationSingletonI
   class FeatureFetcher
   {
     /*
-     * TODO: generalise to track all jalview events to orchestrate batch processing
-     * events.
+     * TODO: generalise to track all jalview events to orchestrate batch
+     * processing events.
      */
 
     private int queued = 0;
@@ -265,6 +265,11 @@ public class Jalview implements ApplicationSingletonI
       System.setSecurityManager(null);
     }
 
+    /*
+     * @j2sNative J2S.db._DirectDatabaseCalls["compbio.dundee.ac.uk"]=null;
+     * @j2sNative J2S.db._DirectDatabaseCalls["jalview.org"]=null;
+     * 
+     */
     System.out
             .println("Java version: " + System.getProperty("java.version"));
     System.out.println("Java Home: " + System.getProperty("java.home"));
@@ -338,13 +343,6 @@ public class Jalview implements ApplicationSingletonI
         }
         headless = true;
       }
-      if (GraphicsEnvironment.isHeadless())
-      {
-        headless = true;
-      }
-      // <<?
-
-      // anything else!
 
       final String jabawsUrl = aparser.getValue(ArgsParser.JABAWS);
       allowServices = !("none".equals(jabawsUrl));
@@ -468,7 +466,12 @@ public class Jalview implements ApplicationSingletonI
         System.out.println("Error setting Taskbar: " + t.getMessage());
       }
       desktop.setVisible(true);
-
+      if (Platform.isJS())
+        Cache.setProperty("SHOW_JWS2_SERVICES", "false");
+      if (allowServices)
+      {
+        desktop.startServiceDiscovery();
+      }
       if (!isJS)
       /**
        * Java only
@@ -476,8 +479,6 @@ public class Jalview implements ApplicationSingletonI
        * @j2sIgnore
        */
       {
-        if (allowServices)
-          desktop.startServiceDiscovery();
         if (!aparser.contains("nousagestats"))
         {
           startUsageStats(desktop);
@@ -770,6 +771,10 @@ public class Jalview implements ApplicationSingletonI
           createOutputFiles(aparser, format);
         }
       }
+      if (headless)
+      {
+        af.getViewport().getCalcManager().shutdown();
+      }
     }
     // extract groovy arguments before anything else.
     // Once all other stuff is done, execute any groovy scripts (in order)