X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSplashScreen.java;h=61273c74994e8ed3318effa0ece24c1b27989aef;hb=1a80985facca80167fb54ca70d9778b1c3bcf9f1;hp=9dfd1d5b118b77d9a9b5e144fc56cfc36ea795d8;hpb=b6f8ec5c6678d0f363c521b97bda9574d04c6338;p=jalview.git diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 9dfd1d5..61273c7 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -59,6 +59,14 @@ public class SplashScreen extends JPanel private JPanel iconimg = new JPanel(new BorderLayout()); + // could change fg, bg, font later to use ChannelProperties (these are not + // actually being used!) + private static Color bg = Color.WHITE; + + private static Color fg = Color.BLACK; + + private static Font font = new Font("SansSerif", Font.PLAIN, FONT_SIZE); + /* * as JTextPane in Java, JLabel in javascript */ @@ -72,6 +80,8 @@ public class SplashScreen extends JPanel private long oldTextLength = -1; + public static int logoSize = 32; + /* * allow click in the initial splash screen to dismiss it * immediately (not if opened from About menu) @@ -119,6 +129,9 @@ public class SplashScreen extends JPanel */ { splashText = new JTextPane(); + splashText.setBackground(bg); + splashText.setForeground(fg); + splashText.setFont(font); Thread t = new Thread(this); t.start(); } @@ -167,12 +180,20 @@ public class SplashScreen extends JPanel { } + this.setBackground(bg); + this.setForeground(fg); + this.setFont(font); + iframe = new JInternalFrame(); iframe.setFrameIcon(null); iframe.setClosable(true); this.setLayout(new BorderLayout()); iframe.setContentPane(this); iframe.setLayer(JLayeredPane.PALETTE_LAYER); + iframe.setBackground(bg); + iframe.setForeground(fg); + iframe.setFont(font); + if (Platform.isJS()) { // ignore in JavaScript @@ -185,9 +206,13 @@ public class SplashScreen extends JPanel */ { ((JTextPane) splashText).setEditable(false); + splashText.setBackground(bg); + splashText.setForeground(fg); + splashText.setFont(font); SplashImage splashimg = new SplashImage(image); - iconimg.add(splashimg, BorderLayout.CENTER); + iconimg.add(splashimg, BorderLayout.LINE_START); + iconimg.setBackground(bg); add(iconimg, BorderLayout.NORTH); } add(splashText, BorderLayout.CENTER); @@ -213,8 +238,9 @@ public class SplashScreen extends JPanel * SwingJS doesn't have HTMLEditorKit, required for a JTextPane * to display formatted html, so we use a simple alternative */ - String text = "


" - + newtext + ""; + String text = "
" + newtext + + "
"; JLabel ta = new JLabel(text); ta.setOpaque(true); ta.setBackground(Color.white); @@ -229,6 +255,9 @@ public class SplashScreen extends JPanel { JTextPane jtp = new JTextPane(); jtp.setEditable(false); + jtp.setBackground(bg); + jtp.setForeground(fg); + jtp.setFont(font); jtp.setContentType("text/html"); jtp.setText("" + newtext + ""); jtp.addHyperlinkListener(this); @@ -237,12 +266,19 @@ public class SplashScreen extends JPanel splashText.addMouseListener(closer); splashText.setVisible(true); - splashText.setSize(new Dimension(750, 375)); + splashText.setSize(new Dimension(750, + 425 + logoSize + (Platform.isJS() ? 40 : 0))); + splashText.setBackground(bg); + splashText.setForeground(fg); + splashText.setFont(font); add(splashText, BorderLayout.CENTER); revalidate(); - iframe.setBounds((Desktop.instance.getWidth() - 750) / 2, - (Desktop.instance.getHeight() - 375) / 2, 750, - splashText.getHeight() + iconimg.getHeight()); + int width = Math.max(splashText.getWidth(), iconimg.getWidth()); + int height = splashText.getHeight() + iconimg.getHeight(); + iframe.setBounds( + Math.max(0, (Desktop.instance.getWidth() - width) / 2), + Math.max(0, (Desktop.instance.getHeight() - height) / 2), + width, height); iframe.validate(); iframe.setVisible(true); return true; @@ -327,10 +363,10 @@ public class SplashScreen extends JPanel @Override public void paintComponent(Graphics g) { - g.setColor(Color.white); + g.setColor(bg); g.fillRect(0, 0, getWidth(), getHeight()); - g.setColor(Color.black); - g.setFont(new Font("Verdana", Font.BOLD, FONT_SIZE + 6)); + g.setColor(fg); + g.setFont(new Font(font.getFontName(), Font.BOLD, FONT_SIZE + 6)); if (image != null) {