From 39e87aa4cc011c4e23286fcd6432d23334cb4cdc Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 12 Dec 2005 18:00:26 +0000 Subject: [PATCH] GetAlignment uses active alignment window --- src/jalview/bin/JalviewLite.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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); } } -- 1.7.10.2