X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FSplashScreen.java;h=2b87e1063a63484fe224628f2005c800d03cb16a;hb=afffa24481a7d3cb65ae41e0948c16a5f490f302;hp=a122eb6b647f41cb272f517a24e19d3992e1b2b4;hpb=bd53adc27eab07569b1944a7c33f31c41dad785f;p=jalview.git
diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java
index a122eb6..2b87e10 100755
--- a/src/jalview/gui/SplashScreen.java
+++ b/src/jalview/gui/SplashScreen.java
@@ -20,6 +20,8 @@
*/
package jalview.gui;
+import jalview.util.Platform;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@@ -35,7 +37,6 @@ import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
-import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
@@ -54,7 +55,7 @@ public class SplashScreen extends JPanel
JPanel iconimg = new JPanel(new BorderLayout());
/**
- * either text area in javascript or in java text pane
+ * either text area in javascript or in java text pane
*/
Component authlist;
@@ -86,7 +87,7 @@ public class SplashScreen extends JPanel
{
this.interactiveDialog = interactive;
// show a splashscreen that will disapper
- if (/** @j2sNative true || */ false)
+ if (Platform.isJS()) // BH 2019
{
authlist = new JLabel("");
run();
@@ -94,7 +95,9 @@ public class SplashScreen extends JPanel
else
{
/**
- * @j2sNative
+ * Java only
+ *
+ * @j2sIgnore
*/
{
authlist = new JTextPane();
@@ -107,6 +110,7 @@ public class SplashScreen extends JPanel
MouseAdapter closer = new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
try
@@ -135,7 +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()
@@ -151,7 +155,6 @@ public class SplashScreen extends JPanel
} catch (InterruptedException x)
{
}
- ;
if (mt.isErrorAny())
{
System.err.println("Error when loading images!");
@@ -169,9 +172,15 @@ 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 ?
- * @j2sNative
+ * Java only
+ *
+ * @j2sIgnore
*/
{
((JTextPane) authlist).setEditable(false);
@@ -200,25 +209,29 @@ public class SplashScreen extends JPanel
{
iframe.setVisible(false);
oldtext = newtext.length();
- if (/** @j2sNative true || */ false)
+ if (Platform.isJS()) // BH 2019
{
- authlist = new JLabel("
![](\"swingjs/j2s/images/Jalview_Logo.png\"/)
"+newtext);
+ authlist = new JLabel(
+ "
![](\"swingjs/j2s/images/Jalview_Logo.png\"/)
"
+ + newtext);
((JLabel) authlist).setOpaque(true);
((JLabel) authlist).setBackground(Color.white);
- } else {
- /**
- * @j2sNative
- */
- {
- authlist = new JTextPane();
- ((JTextPane) authlist).setEditable(false);
- ((JTextPane) authlist).setContentType("text/html");
- ((JTextPane) authlist).setText(newtext);
- ((JTextPane) authlist).addHyperlinkListener(this);
- }
+ }
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ authlist = new JTextPane();
+ ((JTextPane) authlist).setEditable(false);
+ ((JTextPane) authlist).setContentType("text/html");
+ ((JTextPane) authlist).setText(newtext);
+ ((JTextPane) authlist).addHyperlinkListener(this);
}
authlist.addMouseListener(closer);
-
+
authlist.setVisible(true);
authlist.setSize(new Dimension(750, 375));
add(authlist, BorderLayout.CENTER);
@@ -236,6 +249,7 @@ public class SplashScreen extends JPanel
/**
* Create splash screen, display it and clear it off again.
*/
+ @Override
public void run()
{
initSplashScreenWindow();
@@ -297,9 +311,10 @@ public class SplashScreen extends JPanel
public SplashImage(Image todisplay)
{
image = todisplay;
- if (image!=null)
- { setPreferredSize(new Dimension(image.getWidth(this) + 8,
- image.getHeight(this)));
+ if (image != null)
+ {
+ setPreferredSize(new Dimension(image.getWidth(this) + 8,
+ image.getHeight(this)));
}
}
@@ -309,6 +324,7 @@ public class SplashScreen extends JPanel
return new Dimension(image.getWidth(this) + 8, image.getHeight(this));
}
+ @Override
public void paintComponent(Graphics g)
{
g.setColor(Color.white);