Formatting changes
[jalview.git] / src / jalview / gui / SplashScreen.java
index a54a36f..aff93d7 100755 (executable)
+/*\r
+ * Jalview - A Sequence Alignment Editor and Viewer\r
+ * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
+ */\r
 package jalview.gui;\r
 \r
-import javax.swing.*;\r
 import java.awt.*;\r
 import java.awt.event.*;\r
 \r
+import javax.swing.*;\r
+\r
+\r
+/**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @author $author$\r
+ * @version $Revision$\r
+ */\r
 public class SplashScreen extends JPanel implements Runnable\r
 {\r
-  boolean visible = true;\r
-  JInternalFrame iframe;\r
-  Image image;\r
-\r
-  public SplashScreen(JInternalFrame iframe, Image i)\r
-  {\r
-    this.iframe = iframe;\r
-    image = i;\r
-    Thread t = new Thread(this);\r
-    t.start();\r
-    addMouseListener(new MouseAdapter()\r
-    { public void mousePressed(MouseEvent evt)\r
-      {\r
-        try\r
-        {   closeSplash();  }\r
-        catch (Exception ex)\r
-        {}\r
-      }\r
-      });\r
-  }\r
+    boolean visible = true;\r
+    JInternalFrame iframe;\r
+    Image image;\r
+    int fontSize = 11;\r
+    int yoffset = 30;\r
 \r
+    /**\r
+     * Creates a new SplashScreen object.\r
+     *\r
+     * @param iframe DOCUMENT ME!\r
+     * @param i DOCUMENT ME!\r
+     */\r
+    public SplashScreen(JInternalFrame iframe, Image i)\r
+    {\r
+        this.iframe = iframe;\r
+        image = i;\r
 \r
-  public void run()\r
-  {\r
-    long startTime =  System.currentTimeMillis()/1000;\r
+        Thread t = new Thread(this);\r
+        t.start();\r
+        addMouseListener(new MouseAdapter()\r
+            {\r
+                public void mousePressed(MouseEvent evt)\r
+                {\r
+                    try\r
+                    {\r
+                        closeSplash();\r
+                    }\r
+                    catch (Exception ex)\r
+                    {\r
+                    }\r
+                }\r
+            });\r
+    }\r
 \r
-    while( visible )\r
+    /**\r
+     * DOCUMENT ME!\r
+     */\r
+    public void run()\r
     {\r
-      if( System.currentTimeMillis()/1000 - startTime > 5)\r
-        visible = false;\r
+        long startTime = System.currentTimeMillis() / 1000;\r
 \r
-      try{\r
-        Thread.sleep(400);\r
-        iframe.setSelected(true);\r
-      }\r
-      catch(Exception ex){}\r
-    }\r
+        while (visible)\r
+        {\r
+            if (((System.currentTimeMillis() / 1000) - startTime) > 5)\r
+            {\r
+                visible = false;\r
+            }\r
 \r
-    closeSplash();\r
+            try\r
+            {\r
+                Thread.sleep(1000);\r
+            }\r
+            catch (Exception ex)\r
+            {\r
+            }\r
+        }\r
 \r
-  }\r
+        closeSplash();\r
+    }\r
 \r
-  public void closeSplash()\r
-  {\r
-    try\r
+    /**\r
+     * DOCUMENT ME!\r
+     */\r
+    public void closeSplash()\r
     {\r
-      iframe.setClosed(true);\r
+        try\r
+        {\r
+            iframe.setClosed(true);\r
+        }\r
+        catch (Exception ex)\r
+        {\r
+        }\r
     }\r
-    catch (Exception ex)\r
-    {}\r
-\r
-  }\r
 \r
-  int fontSize = 11;\r
-  int yoffset = 30;\r
-  public void paintComponent(Graphics g)\r
-  {\r
-    g.setColor(Color.white);\r
-    g.fillRect(0,0,getWidth(),getHeight());\r
-    g.setColor(Color.black);\r
-    g.setFont( new Font("Verdana", Font.BOLD, fontSize+4));\r
-    if(image!=null)\r
-    g.drawImage(image, 5,yoffset+10,this);\r
-    g.drawString("JalView 2005", 50,yoffset);\r
-    g.setFont( new Font("Verdana", Font.BOLD, fontSize));\r
-    g.drawString("Authors: Michele Clamp, James Cuff, Steve Searle, Andrew Waterhouse, Jim Procter & Geoff Barton.",50,yoffset+20);\r
-    g.drawString("Current development managed by Andrew Waterhouse; Barton Group, University of Dundee.",50,yoffset+20+fontSize);\r
-    g.drawString("If  you use JalView, please cite:",50,yoffset+20+fontSize*2);\r
-    g.drawString("\"Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004), The Jalview Java Alignment Editor\"",50,yoffset+20+fontSize*3);\r
+    /**\r
+     * DOCUMENT ME!\r
+     *\r
+     * @param g DOCUMENT ME!\r
+     */\r
+    public void paintComponent(Graphics g)\r
+    {\r
+        g.setColor(Color.white);\r
+        g.fillRect(0, 0, getWidth(), getHeight());\r
+        g.setColor(Color.black);\r
+        g.setFont(new Font("Verdana", Font.BOLD, fontSize + 6));\r
 \r
-  }\r
+        if (image != null)\r
+        {\r
+            g.drawImage(image, 5, yoffset + 12, this);\r
+        }\r
 \r
+        g.drawString("JalView 2005 ", 50, yoffset);\r
+        g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2));\r
+        g.drawString("Version " + jalview.bin.Cache.VERSION +\r
+            "; Last updated: " + jalview.bin.Cache.BUILD_DATE, 180, yoffset);\r
+        g.setFont(new Font("Verdana", Font.BOLD, fontSize));\r
+        g.drawString("Authors: Michele Clamp, James Cuff, Steve Searle, Andrew Waterhouse, Jim Procter & Geoff Barton.",\r
+            50, yoffset + 20);\r
+        g.drawString("Current development managed by Andrew Waterhouse; Barton Group, University of Dundee.",\r
+            50, yoffset + 24 + fontSize);\r
+        g.drawString("If  you use JalView, please cite: Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. (2004),",\r
+            50, yoffset + 28 + (fontSize * 2));\r
+        g.drawString("\"The Jalview Java Alignment Editor\" Bioinformatics,  2004 12;426-7.",\r
+            50, yoffset + 32 + (fontSize * 3));\r
+    }\r
 }\r