j2sNative references moved to Platform
[jalview.git] / src / jalview / bin / Jalview.java
index 474c707..fbdb65f 100755 (executable)
@@ -41,8 +41,6 @@ import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.ws.jws2.Jws2Discoverer;
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -67,7 +65,6 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.swing.LookAndFeel;
-import javax.swing.Timer;
 import javax.swing.UIManager;
 
 import groovy.lang.Binding;
@@ -102,21 +99,9 @@ public class Jalview
 
   public static AlignFrame currentAlignFrame;
 
-  /**
-   * Answers true if Jalview is running as Javascript, else false. The value is
-   * set at compile time.
-   * 
-   * @return
-   */
-  public static boolean isJS()
-  {
-    return /** @j2sNative true || */
-    false;
-  }
-
   static
   {
-    if (!isJS())
+    if (!Platform.isJS())
     { // BH 2018
     // grab all the rights we can the JVM
     Policy.setPolicy(new Policy()
@@ -229,7 +214,7 @@ public class Jalview
   private static void setLogging() 
   {
          // BH - for event debugging in JavaScript (Java mode only)
-       if (!(/** @j2sNative true ||*/false)) 
+       if (!Platform.isJS()) 
        {
                Logger.getLogger("").setLevel(Level.ALL);
         logClass("java.awt.EventDispatchThread");
@@ -250,7 +235,7 @@ public class Jalview
   void doMain(String[] args)
   {
 
-    if (!isJS())
+    if (!Platform.isJS())
     {
       System.setSecurityManager(null);
     }
@@ -272,12 +257,7 @@ public class Jalview
               "CMD [-props " + usrPropsFile + "] executed successfully!");
     }
 
-    /**
-     * BH 2018 ignoring this section for JS
-     * 
-     * @j2sNative
-     */
-    {
+    if (!Platform.isJS()) {
       if (aparser.contains("help") || aparser.contains("h"))
       {
         showUsage();
@@ -413,13 +393,8 @@ public class Jalview
       desktop.setInBatchMode(true); // indicate we are starting up
       desktop.setVisible(true);
 
-      /**
-       * BH 2018 JS bypass this section
-       * 
-       * @j2sNative
-       * 
-       */
-      {
+
+      if (!Platform.isJS()) {
         desktop.startServiceDiscovery();
         if (!aparser.contains("nousagestats"))
         {
@@ -590,7 +565,7 @@ public class Jalview
       }
       System.out.println("CMD [-open " + file + "] executed successfully!");
 
-      if (!isJS() && !file.startsWith("http://"))
+      if (!Platform.isJS() && !file.startsWith("http://"))
       {
         if (!(new File(file)).exists())
         {
@@ -834,8 +809,7 @@ public class Jalview
     // And the user
     // ////////////////////
 
-    if (/** @j2sNative false && */ // BH 2018
-    !headless && file == null && vamsasImport == null
+    if (!Platform.isJS() && !headless && file == null && vamsasImport == null
             && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
     {
       file = jalview.bin.Cache.getDefault("STARTUP_FILE",