2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
21 import java.awt.event.*;
30 public class SplashScreen extends JPanel implements Runnable
32 boolean visible = true;
34 JInternalFrame iframe;
43 * Creates a new SplashScreen object.
47 Thread t = new Thread(this);
52 * ping the jalview version page then create and display the jalview
53 * splashscreen window.
55 void initSplashScreenWindow()
57 addMouseListener(new MouseAdapter()
59 public void mousePressed(MouseEvent evt)
65 } catch (Exception ex)
73 java.net.URL url = getClass().getResource("/images/logo.gif");
77 image = java.awt.Toolkit.getDefaultToolkit().createImage(url);
79 MediaTracker mt = new MediaTracker(this);
80 mt.addImage(image, 0);
82 Desktop.instance.setIconImage(image);
84 } catch (Exception ex)
88 iframe = new JInternalFrame();
89 iframe.setFrameIcon(null);
90 iframe.setClosable(false);
91 iframe.setContentPane(this);
92 iframe.setLayer(JLayeredPane.PALETTE_LAYER);
94 Desktop.desktop.add(iframe);
96 iframe.setVisible(true);
97 iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
98 (int) ((Desktop.instance.getHeight() - 160) / 2), 750, 190);
102 * Create splash screen, display it and clear it off again.
106 initSplashScreenWindow();
107 long startTime = System.currentTimeMillis() / 1000;
114 } catch (Exception ex)
118 if (((System.currentTimeMillis() / 1000) - startTime) > 5)
132 public void closeSplash()
137 iframe.setClosed(true);
138 } catch (Exception ex)
149 public void paintComponent(Graphics g)
151 g.setColor(Color.white);
152 g.fillRect(0, 0, getWidth(), getHeight());
153 g.setColor(Color.black);
154 g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
158 g.drawImage(image, 5, yoffset + 12, this);
163 g.drawString("Jalview " + jalview.bin.Cache.getProperty("VERSION"), 50,
166 FontMetrics fm = g.getFontMetrics();
167 int vwidth = fm.stringWidth("Jalview "
168 + jalview.bin.Cache.getProperty("VERSION"));
169 g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));
172 + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
174 if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
177 // Displayed when code version and jnlp version do not match
178 g.drawString("...Checking latest version...", 50, y += fontSize + 10);
180 g.setColor(Color.black);
182 else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking")
183 .equals(jalview.bin.Cache.getProperty("VERSION")))
185 if (jalview.bin.Cache.getProperty("VERSION").toLowerCase()
186 .indexOf("automated build") == -1)
188 // Displayed when code version and jnlp version do not match and code
189 // version is not a development build
190 g.setColor(Color.red);
193 "!! Jalview version "
194 + jalview.bin.Cache.getDefault("LATEST_VERSION",
196 + " is available for download from http://www.jalview.org !!",
197 50, y += fontSize + 10);
199 g.setColor(Color.black);
202 g.setFont(new Font("Verdana", Font.BOLD, fontSize));
204 "Authors: Jim Procter, Andrew Waterhouse, Michele Clamp, James Cuff, Steve Searle,",
205 50, y += fontSize + 4);
206 g.drawString("David Martin & Geoff Barton.", 60, y += fontSize + 4);
208 "Development managed by The Barton Group, University of Dundee.",
209 50, y += fontSize + 4);
210 g.drawString("If you use Jalview, please cite: ", 50,
213 "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)",
214 50, y += fontSize + 4);
216 "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench",
217 50, y += fontSize + 4);
218 g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50,