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 java.applet.Applet;
\r
17 public class Jalview extends JApplet
\r
19 public static JApplet applet;
\r
25 frame = new Desktop();
\r
26 frame.setResizable(true);
\r
27 frame.setVisible(true);
\r
28 frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
\r
29 frame.addWindowListener(new WindowAdapter()
\r
31 public void windowClosing(WindowEvent e)
\r
38 String file = getParameter("alignment");
\r
42 jalview.bin.Cache.LAST_DIRECTORY = file;
\r
43 String protocol = "File";
\r
44 if (file.indexOf("http:") > -1)
\r
47 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
49 frame.LoadFile(file, protocol, format);
\r
53 public void destroy()
\r
59 frame.setVisible(false);
\r
62 public static void main(String[] args) {
\r
64 UIManager.setLookAndFeel(
\r
65 // "javax.swing.plaf.metal.MetalLookAndFeel"
\r
66 // "javax.swing.plaf.multi.MultiLookAndFeel"
\r
67 UIManager.getCrossPlatformLookAndFeelClassName()
\r
68 // "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"
\r
69 // "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
\r
70 // "com.sun.java.swing.plaf.motif.MotifLookAndFeel"
\r
73 catch (Exception ex)
\r
76 // JFrame.setDefaultLookAndFeelDecorated(true);
\r
77 Desktop frame = new Desktop();
\r
78 frame.setResizable(true);
\r
79 frame.setVisible(true);
\r
82 if(args!=null && args.length>0)
\r
84 String file = args[0];
\r
85 jalview.bin.Cache.LAST_DIRECTORY = file;
\r
86 String protocol = "File";
\r
87 if(file.indexOf("http:")>-1)
\r
90 String format = jalview.io.IdentifyFile.Identify(file, protocol);
\r
92 frame.LoadFile(file, protocol, format);
\r