JAL-3210 Improvements to eclipse detection. New src tree and SwingJS updated from...
[jalview.git] / src / jalview / bin / Jalview.java
index 7970437..f59c37f 100755 (executable)
@@ -305,6 +305,15 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
 
     String usrPropsFile = aparser.getValue(ArgsParser.PROPS);
     Cache.loadProperties(usrPropsFile);
+
+    if (aparser.contains(ArgsParser.NODISPLAY)
+            || aparser.contains(ArgsParser.NOGUI)
+            || aparser.contains(ArgsParser.HEADLESS)
+            || "true".equals(System.getProperty("java.awt.headless")))
+    {
+      headless = true;
+    }
+
     if (isJS)
     {
       isJavaAppletTag = aparser.isApplet();
@@ -336,13 +345,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
         showUsage();
         System.exit(0);
       }
-      if (aparser.contains(ArgsParser.NODISPLAY)
-              || aparser.contains(ArgsParser.NOGUI)
-              || aparser.contains(ArgsParser.HEADLESS)
-              || "true".equals(System.getProperty("java.awt.headless")))
-      {
-        headless = true;
-      }
+
 
       // anything else!
 
@@ -398,7 +401,13 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
 
     try
     {
-      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+      if (!isJS && Platform.isWin())
+       {
+        UIManager.setLookAndFeel(
+                headless ? "javax.swing.plaf.metal.MetalLookAndFeel"
+                        : UIManager.getSystemLookAndFeelClassName());
+//      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+      }
     } catch (Exception ex)
     {
       System.err.println("Unexpected Look and Feel Exception");
@@ -849,11 +858,11 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
                     + "] executed successfully!");
             groovyscript = null;
           }
-          checkOutputFile(aparser, af, format);
-          while (aparser.getSize() > 0)
-          {
-            System.out.println("Unknown arg: " + aparser.nextValue());
-          }
+        }
+        checkOutputFile(aparser, af, format);
+        while (aparser.getSize() > 0)
+        {
+          System.out.println("Unknown arg: " + aparser.nextValue());
         }
       }
     }
@@ -1043,6 +1052,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
       // biojsmsa filename
       String outputFormat = aparser.nextValue();
       String file = aparser.nextValue();
+      System.out.println("format " + outputFormat);
+
       if (outputFormat.equalsIgnoreCase("png"))
       {
         af.createPNG(new File(file));
@@ -2052,8 +2063,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
 
   public void notifyWorker(AlignCalcWorkerI worker, String status)
   {
-    System.out.println("Jalview worker " + worker.getClass().getSimpleName()
-            + " " + status);
+    // System.out.println("Jalview worker " + worker.getClass().getSimpleName()
+    // + " " + status);
   }
 
 }