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
18 public class Jalview extends JApplet
\r
20 public static JApplet applet;
\r
26 frame = new Desktop();
\r
27 frame.setResizable(true);
\r
28 frame.setVisible(true);
\r
29 frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
\r
30 frame.addWindowListener(new WindowAdapter()
\r
32 public void windowClosing(WindowEvent e)
\r
39 String file = getParameter("alignment");
\r
43 jalview.bin.Cache.setProperty("LAST_DIRECTORY", file);
\r
44 String protocol = "File";
\r
45 if (file.indexOf("http:") > -1)
\r
48 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
50 frame.LoadFile(file, protocol, format);
\r
54 public void destroy()
\r
60 frame.setVisible(false);
\r
63 public static void main(String[] args) {
\r
65 Cache.loadProperties();
\r
68 UIManager.setLookAndFeel(
\r
69 // "javax.swing.plaf.metal.MetalLookAndFeel"
\r
70 // "javax.swing.plaf.multi.MultiLookAndFeel"
\r
71 UIManager.getCrossPlatformLookAndFeelClassName()
\r
72 // "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
\r
73 // "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
\r
74 // "com.sun.java.swing.plaf.motif.MotifLookAndFeel"
\r
77 catch (Exception ex)
\r
80 // JFrame.setDefaultLookAndFeelDecorated(true);
\r
81 Desktop frame = new Desktop();
\r
82 frame.setResizable(true);
\r
83 frame.setVisible(true);
\r
86 if(args!=null && args.length>0)
\r
88 String file = args[0];
\r
89 String protocol = "File";
\r
90 if(file.indexOf("http:")>-1)
\r
93 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
95 frame.LoadFile(file, protocol, format);
\r