j2sNative clean-up. Fixes problem with second try of sequence fetching
[jalview.git] / src / jalview / gui / SplashScreen.java
index 52bd64f..f7d7cbf 100755 (executable)
@@ -88,7 +88,6 @@ public class SplashScreen extends JPanel
     this.interactiveDialog = interactive;
     // show a splashscreen that will disapper
     if (Platform.isJS()) // BH 2019
-    // if (/** @j2sNative true || */ false)
     {
       authlist = new JLabel("");
       run();
@@ -140,8 +139,7 @@ public class SplashScreen extends JPanel
       java.net.URL urllogo = getClass()
               .getResource("/images/Jalview_Logo_small.png");
 
-      if (/** @j2sNative false || */
-      url != null)
+      if (!Platform.isJS() && url != null)
       {
         image = java.awt.Toolkit.getDefaultToolkit().createImage(url);
         Image logo = java.awt.Toolkit.getDefaultToolkit()
@@ -157,7 +155,6 @@ public class SplashScreen extends JPanel
           } catch (InterruptedException x)
           {
           }
-          ;
           if (mt.isErrorAny())
           {
             System.err.println("Error when loading images!");
@@ -175,8 +172,13 @@ public class SplashScreen extends JPanel
     this.setLayout(new BorderLayout());
     iframe.setContentPane(this);
     iframe.setLayer(JLayeredPane.PALETTE_LAYER);
+    if (Platform.isJS())
+    {
+      // ignore in JavaScript
+    }
+    else
     /**
-     * we add image directly in html for javascript ?
+     * Java only
      * 
      * @j2sNative
      */
@@ -208,7 +210,6 @@ public class SplashScreen extends JPanel
       iframe.setVisible(false);
       oldtext = newtext.length();
       if (Platform.isJS()) // BH 2019
-      // if (/** @j2sNative true || */ false)
       {
         authlist = new JLabel(
                 "<html><br/><br/><img src=\"swingjs/j2s/images/Jalview_Logo.png\"/><br/>"
@@ -217,19 +218,17 @@ public class SplashScreen extends JPanel
         ((JLabel) authlist).setBackground(Color.white);
       }
       else
+      /**
+       * Java only
+       * 
+       * @j2sNative
+       */
       {
-        /**
-         * Java only
-         * 
-         * @j2sNative
-         */
-        {
-          authlist = new JTextPane();
-          ((JTextPane) authlist).setEditable(false);
-          ((JTextPane) authlist).setContentType("text/html");
-          ((JTextPane) authlist).setText(newtext);
-          ((JTextPane) authlist).addHyperlinkListener(this);
-        }
+        authlist = new JTextPane();
+        ((JTextPane) authlist).setEditable(false);
+        ((JTextPane) authlist).setContentType("text/html");
+        ((JTextPane) authlist).setText(newtext);
+        ((JTextPane) authlist).addHyperlinkListener(this);
       }
       authlist.addMouseListener(closer);