GPL license added
[jalview.git] / src / jalview / bin / Jalview.java
index 6f4a8d5..2524abd 100755 (executable)
@@ -1,11 +1,21 @@
-/********************\r
- * 2004 Jalview Reengineered\r
- * Barton Group\r
- * Dundee University\r
- *\r
- * AM Waterhouse\r
- *******************/\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
 \r
 package jalview.bin;\r
 \r
@@ -23,6 +33,8 @@ public class Jalview extends JApplet
   public void init()\r
   {\r
     applet = this;\r
+    Cache.loadProperties();\r
+    jalview.gui.Preferences.initPreferences();\r
 \r
     frame = new Desktop();\r
     frame.setResizable(true);\r
@@ -75,10 +87,12 @@ public class Jalview extends JApplet
    public static void main(String[] args) {\r
 \r
     Cache.loadProperties();\r
+    jalview.gui.Preferences.initPreferences();\r
     try {\r
       initLogger();\r
     } catch (Exception e) {\r
-      System.out.println("Problems initializing the log4j system\n"+e);\r
+      System.err.println("Problems initializing the log4j system\n");\r
+      e.printStackTrace();\r
     }\r
     try{\r
        UIManager.setLookAndFeel(\r
@@ -117,6 +131,25 @@ public class Jalview extends JApplet
          frame.LoadFile(file, protocol, format);\r
      }\r
 \r
+     if(jalview.gui.Preferences.showStartupFile &&\r
+         jalview.gui.Preferences.startupFile!=null)\r
+     {\r
+       String file = jalview.gui.Preferences.startupFile;\r
+       String protocol = "File";\r
+       if (file.indexOf("http:") > -1)\r
+         protocol = "URL";\r
+\r
+       if(file.endsWith(".jar"))\r
+         Jalview2XML.LoadJalviewAlign(file);\r
+       else\r
+       {\r
+         String format = jalview.io.IdentifyFile.Identify(file, protocol);\r
+         frame.LoadFile(file, protocol, format);\r
+       }\r
+     }\r
+\r
+\r
+\r
    }\r
 \r
 }\r