Formatted source
[jalview.git] / src / jalview / gui / SplashScreen.java
index 794bbb8..6edab5d 100755 (executable)
@@ -1,66 +1,78 @@
 /*\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
-\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
+import javax.swing.*;\r
 \r
-public class SplashScreen extends JPanel implements Runnable\r
+public class SplashScreen\r
+    extends JPanel implements Runnable\r
 {\r
   boolean visible = true;\r
   JInternalFrame iframe;\r
   Image image;\r
+  int fontSize = 11;\r
+  int yoffset = 30;\r
 \r
   public SplashScreen(JInternalFrame iframe, Image i)\r
   {\r
     this.iframe = iframe;\r
     image = i;\r
+\r
     Thread t = new Thread(this);\r
     t.start();\r
     addMouseListener(new MouseAdapter()\r
-    { public void mousePressed(MouseEvent evt)\r
+    {\r
+      public void mousePressed(MouseEvent evt)\r
       {\r
         try\r
-        {   closeSplash();  }\r
+        {\r
+          closeSplash();\r
+        }\r
         catch (Exception ex)\r
-        {}\r
+        {\r
+        }\r
       }\r
-      });\r
+    });\r
   }\r
 \r
-\r
   public void run()\r
   {\r
-    long startTime =  System.currentTimeMillis()/1000;\r
+    long startTime = System.currentTimeMillis() / 1000;\r
 \r
-    while( visible )\r
+    while (visible)\r
     {\r
-      if( System.currentTimeMillis()/1000 - startTime > 5)\r
+      if ( ( (System.currentTimeMillis() / 1000) - startTime) > 5)\r
+      {\r
         visible = false;\r
+      }\r
 \r
-      try{\r
+      try\r
+      {\r
         Thread.sleep(1000);\r
       }\r
-      catch(Exception ex){}\r
+      catch (Exception ex)\r
+      {\r
+      }\r
     }\r
+\r
     closeSplash();\r
   }\r
 \r
@@ -71,29 +83,36 @@ public class SplashScreen extends JPanel implements Runnable
       iframe.setClosed(true);\r
     }\r
     catch (Exception ex)\r
-    {}\r
-\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.fillRect(0, 0, getWidth(), getHeight());\r
     g.setColor(Color.black);\r
-    g.setFont( new Font("Verdana", Font.BOLD, fontSize+6));\r
-    if(image!=null)\r
-    g.drawImage(image, 5,yoffset+12,this);\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+"; 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.",50,yoffset+20);\r
-    g.drawString("Current development managed by Andrew Waterhouse; Barton Group, University of Dundee.",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),",50,yoffset+28+fontSize*2);\r
-    g.drawString("\"The Jalview Java Alignment Editor\" Bioinformatics,  2004 12;426-7.",50,yoffset+32+fontSize*3);\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,\r
+                 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(\r
+        "\"The Jalview Java Alignment Editor\" Bioinformatics,  2004 12;426-7.",\r
+        50, yoffset + 32 + (fontSize * 3));\r
+  }\r
 }\r