JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / jalview / util / Platform.java
index efec5f7..573e2d5 100644 (file)
@@ -52,7 +52,7 @@ public class Platform
           false;
 
   private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
-          isWin = null;
+          isWin = null, isLinux = null;
 
   private static Boolean isHeadless = null;
 
@@ -81,6 +81,19 @@ public class Platform
   }
 
   /**
+   * added to check LaF for Linux
+   * 
+   * @return
+   */
+  public static boolean isLinux()
+  {
+    return (isLinux == null
+            ? (isLinux = (System.getProperty("os.name")
+                    .indexOf("Linux") >= 0))
+            : isLinux);
+  }
+
+  /**
    * 
    * @return true if HTML5 JavaScript
    */
@@ -337,7 +350,7 @@ public class Platform
 
   public static byte[] getFileBytes(File f)
   {
-    return /** @j2sNative f && swingjs.JSUtil.getFileBytes$java_io_File(f) || */
+    return /** @j2sNative f && swingjs.JSUtil.getFileAsBytes$O(f) || */
     null;
   }
 
@@ -510,8 +523,7 @@ public class Platform
 
   public static Object parseJSON(String json) throws ParseException
   {
-    return (isJS() ? JSON.parse(json)
-            : new JSONParser().parse(json));
+    return (isJS() ? JSON.parse(json) : new JSONParser().parse(json));
   }
 
   public static Object parseJSON(Reader r)
@@ -543,8 +555,8 @@ public class Platform
    * @param is
    * @param outFile
    * @throws IOException
-   *                       if the file cannot be created or there is a problem
-   *                       reading the input stream.
+   *           if the file cannot be created or there is a problem reading the
+   *           input stream.
    */
   public static void streamToFile(InputStream is, File outFile)
           throws IOException
@@ -588,8 +600,8 @@ public class Platform
     if (isJS())
     {
       System.out.println(
-            "Platform adding known access-control-allow-origin * for domain "
-                    + domain);
+              "Platform adding known access-control-allow-origin * for domain "
+                      + domain);
       /**
        * @j2sNative
        * 
@@ -601,7 +613,8 @@ public class Platform
 
   public static void getURLCommandArguments()
   {
-      try {
+    try
+    {
       /**
        * Retrieve the first query field as command arguments to Jalview. Include
        * only if prior to "?j2s" or "&j2s" or "#". Assign the applet's
@@ -609,9 +622,13 @@ public class Platform
        * 
        * @j2sNative var a =
        *            decodeURI((document.location.href.replace("&","?").split("?j2s")[0]
-       *            + "?").split("?")[1].split("#")[0]); a && (System.out.println("URL arguments detected were "+a)) &&
-       *            (J2S.thisApplet.__Info.urlargs = a.split(" ")); 
-       *            (!!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args == "" || J2S.thisApplet.__Info.args == "??") && (J2S.thisApplet.__Info.args = a) && (System.out.println("URL arguments were passed to J2S main."));
+       *            + "?").split("?")[1].split("#")[0]); a &&
+       *            (System.out.println("URL arguments detected were "+a)) &&
+       *            (J2S.thisApplet.__Info.urlargs = a.split(" "));
+       *            (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args
+       *            == "" || J2S.thisApplet.__Info.args == "??") &&
+       *            (J2S.thisApplet.__Info.args = a) && (System.out.println("URL
+       *            arguments were passed to J2S main."));
        */
     } catch (Throwable t)
     {
@@ -619,8 +636,8 @@ public class Platform
   }
 
   /**
-   * A (case sensitive) file path comparator that ignores the difference between /
-   * and \
+   * A (case sensitive) file path comparator that ignores the difference between
+   * / and \
    * 
    * @param path1
    * @param path2