From: amwaterhouse Date: Tue, 25 Jan 2005 17:05:33 +0000 (+0000) Subject: extends Applet X-Git-Tag: Release_2_0~724 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5e3b30218383ee6da117dbebf824e56c7c67943f;p=jalview.git extends Applet --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index be0440a..69fd7b0 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -11,9 +11,53 @@ package jalview.bin; import jalview.gui.*; import javax.swing.*; +import java.awt.event.*; +import java.applet.Applet; -public class Jalview +public class Jalview extends JApplet { + public static JApplet applet; + Desktop frame; + public void init() + { + applet = this; + + frame = new Desktop(); + frame.setResizable(true); + frame.setVisible(true); + frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + frame.addWindowListener(new WindowAdapter() + { + public void windowClosing(WindowEvent e) + { + applet.stop(); + applet.destroy(); + } + }); + + String file = getParameter("alignment"); + + if(file!=null) + { + jalview.bin.Cache.LAST_DIRECTORY = file; + String protocol = "File"; + if (file.indexOf("http:") > -1) + protocol = "URL"; + + String format = jalview.io.IdentifyFile.Identify(file, protocol); + + frame.LoadFile(file, protocol, format); + } + } + + public void destroy() + { + System.out.println("Goodbyeee"); + + applet.stop(); + frame.setVisible(false); + + } public static void main(String[] args) { try{