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