1 /********************
\r
2 * 2004 Jalview Reengineered
\r
10 package jalview.bin;
\r
12 import jalview.gui.*;
\r
13 import javax.swing.*;
\r
14 import java.awt.event.*;
\r
15 import jalview.io.*;
\r
17 import org.apache.log4j.*;
\r
19 public class Jalview extends JApplet
\r
21 public static JApplet applet;
\r
27 frame = new Desktop();
\r
28 frame.setResizable(true);
\r
29 frame.setVisible(true);
\r
30 frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
\r
31 frame.addWindowListener(new WindowAdapter()
\r
33 public void windowClosing(WindowEvent e)
\r
40 String file = getParameter("alignment");
\r
44 jalview.bin.Cache.setProperty("LAST_DIRECTORY", file);
\r
45 String protocol = "File";
\r
46 if (file.indexOf("http:") > -1)
\r
49 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
51 frame.LoadFile(file, protocol, format);
\r
55 public void destroy()
\r
61 frame.setVisible(false);
\r
64 private static void initLogger() {
\r
65 Logger l = Logger.getLogger("org.apache.axis");
\r
66 l.setLevel(Level.INFO);
\r
67 ConsoleAppender ap = new ConsoleAppender(new SimpleLayout(),"System.err");
\r
71 public static void main(String[] args) {
\r
73 Cache.loadProperties();
\r
76 } catch (Exception e) {
\r
77 System.out.println("Failed to initialise the log4j system for axis\n"+e);
\r
80 UIManager.setLookAndFeel(
\r
81 // "javax.swing.plaf.metal.MetalLookAndFeel"
\r
82 // "javax.swing.plaf.multi.MultiLookAndFeel"
\r
83 UIManager.getSystemLookAndFeelClassName()
\r
84 // UIManager.getCrossPlatformLookAndFeelClassName()
\r
85 // "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
\r
86 // "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
\r
87 // "com.sun.java.swing.plaf.motif.MotifLookAndFeel"
\r
90 catch (Exception ex)
\r
93 // JFrame.setDefaultLookAndFeelDecorated(true);
\r
94 Desktop frame = new Desktop();
\r
95 frame.setResizable(true);
\r
96 frame.setVisible(true);
\r
99 if(args!=null && args.length>0)
\r
101 String file = args[0];
\r
102 String protocol = "File";
\r
103 if(file.indexOf("http:")>-1)
\r
106 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
108 frame.LoadFile(file, protocol, format);
\r