From: amwaterhouse Date: Mon, 12 Dec 2005 18:00:26 +0000 (+0000) Subject: GetAlignment uses active alignment window X-Git-Tag: Root_VamJalview_2_07b+~245 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=39e87aa4cc011c4e23286fcd6432d23334cb4cdc;p=jalview.git GetAlignment uses active alignment window --- diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index be4675f..7838755 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -45,7 +45,7 @@ public class JalviewLite extends Applet String file = "No file"; Button launcher = new Button("Start Jalview"); - AlignFrame currentAlignFrame; + static AlignFrame currentAlignFrame; /** @@ -159,10 +159,20 @@ public class JalviewLite extends Applet { public void windowClosing(WindowEvent e) { + if(currentAlignFrame == frame) + { + currentAlignFrame = null; + } lastFrameX -=40; lastFrameY-=40; frame.dispose(); } + public void windowActivated(WindowEvent e) + { + if(frame instanceof AlignFrame) + currentAlignFrame = (AlignFrame)frame; + } + }); frame.setVisible(true); } @@ -183,9 +193,9 @@ public class JalviewLite extends Applet return reply; } catch (Exception ex) - {ex.printStackTrace(); + { + ex.printStackTrace(); return "Error retrieving alignment in " + format + " format. "; - } } @@ -259,7 +269,7 @@ public class JalviewLite extends Applet tp = new TreePanel(currentAlignFrame.viewport, currentAlignFrame.viewport.getAlignment().getSequences(), fin, "FromFile", applet.getCodeBase() + treeFile); - jalview.bin.JalviewLite.addFrame(tp, treeFile, 600, 500); + addFrame(tp, treeFile, 600, 500); currentAlignFrame.addTreeMenuItem(tp, treeFile); } }