+ public static void main(String[] args) {\r
+ Cache.loadProperties();\r
+ jalview.gui.Preferences.initPreferences();\r
+\r
+ try {\r
+ initLogger();\r
+ } catch (Exception e) {\r
+ System.err.println("Problems initializing the log4j system\n");\r
+ e.printStackTrace();\r
+ }\r
+\r
+ try {\r
+ UIManager.setLookAndFeel(\r
+ // "javax.swing.plaf.metal.MetalLookAndFeel"\r
+ // "javax.swing.plaf.multi.MultiLookAndFeel"\r
+ UIManager.getSystemLookAndFeelClassName());\r
+ } catch (Exception ex) {\r
+ }\r
+\r
+ Desktop frame = new Desktop();\r
+ frame.setResizable(true);\r
+ frame.setVisible(true);\r
+\r
+ if ((args != null) && (args.length > 0)) {\r
+ String file = null;\r
+\r
+ if (args[0].equals("-open")) {\r
+ file = args[1];\r
+ } else {\r
+ file = args[0];\r
+ }\r
+\r
+ String protocol = "File";\r
+\r
+ if (file.indexOf("http:") > -1) {\r
+ protocol = "URL";\r
+ }\r
+\r
+ String format = jalview.io.IdentifyFile.Identify(file, protocol);\r
+\r
+ frame.LoadFile(file, protocol, format);\r
+ }\r
+\r
+ if (jalview.gui.Preferences.showStartupFile &&\r
+ (jalview.gui.Preferences.startupFile != null)) {\r
+ String file = jalview.gui.Preferences.startupFile;\r
+ String protocol = "File";\r
+\r
+ if (file.indexOf("http:") > -1) {\r
+ protocol = "URL";\r
+ }\r
+\r
+ if (file.endsWith(".jar")) {\r
+ Jalview2XML.LoadJalviewAlign(file);\r
+ } else {\r
+ String format = jalview.io.IdentifyFile.Identify(file, protocol);\r
+ frame.LoadFile(file, protocol, format);\r
+ }\r
+ }\r
+ }\r