Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / jalview / bin / Jalview.java
index 4f76776..75504be 100755 (executable)
@@ -110,7 +110,6 @@ public class Jalview implements ApplicationSingletonI
   // }
   public static Jalview getInstance()
   {
-    System.out.println("Hello, MW!!!!!!!!!!!!");
     return (Jalview) ApplicationSingletonProvider
             .getInstance(Jalview.class);
   }
@@ -187,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;
@@ -339,13 +338,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));
@@ -469,7 +461,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
@@ -477,8 +474,6 @@ public class Jalview implements ApplicationSingletonI
        * @j2sIgnore
        */
       {
-        if (allowServices)
-          desktop.startServiceDiscovery();
         if (!aparser.contains("nousagestats"))
         {
           startUsageStats(desktop);
@@ -771,6 +766,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)