2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 import java.awt.event.*;
33 public class SplashScreen extends JPanel implements Runnable
35 boolean visible = true;
36 JInternalFrame iframe;
42 * Creates a new SplashScreen object.
44 * @param iframe DOCUMENT ME!
45 * @param i DOCUMENT ME!
47 public SplashScreen(JInternalFrame iframe, Image i)
52 Thread t = new Thread(this);
54 addMouseListener(new MouseAdapter()
56 public void mousePressed(MouseEvent evt)
74 long startTime = System.currentTimeMillis() / 1000;
78 if (((System.currentTimeMillis() / 1000) - startTime) > 5)
99 public void closeSplash()
103 iframe.setClosed(true);
107 ex.printStackTrace();
114 * @param g DOCUMENT ME!
116 public void paintComponent(Graphics g)
118 g.setColor(Color.white);
119 g.fillRect(0, 0, getWidth(), getHeight());
120 g.setColor(Color.black);
121 g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));
125 g.drawImage(image, 5, yoffset + 12, this);
130 g.drawString("Jalview "+jalview.bin.Cache.getProperty("VERSION"), 50, y);
132 FontMetrics fm = g.getFontMetrics();
133 int vwidth = fm.stringWidth("Jalview "+jalview.bin.Cache.getProperty("VERSION"));
134 g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));
135 g.drawString("Last updated: " + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"),
138 if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals("Checking"))
140 // Displayed when code version and jnlp version do not match
141 g.drawString("...Checking latest version...",
142 50, y += fontSize + 10);
144 g.setColor(Color.black);
146 else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals(
147 jalview.bin.Cache.getProperty("VERSION")))
149 // Displayed when code version and jnlp version do not match
150 g.setColor(Color.red);
151 g.drawString("!! Jalview version " +
152 jalview.bin.Cache.getDefault("LATEST_VERSION", "..Checking..")
153 + " is available for download from http://www.jalview.org !!",
154 50, y += fontSize + 10);
156 g.setColor(Color.black);
159 g.setFont(new Font("Verdana", Font.BOLD, fontSize));
160 g.drawString("Authors: Michele Clamp, James Cuff, Steve Searle, Andrew Waterhouse, Jim Procter & Geoff Barton.",
162 g.drawString("Current development managed by Andrew Waterhouse; Barton Group, University of Dundee.",
164 g.drawString("If you use JalView, please cite: Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004),",
166 g.drawString("\"The Jalview Java Alignment Editor\" Bioinformatics, 2004 20; 426-7.",