From 3f623a3bc7194d4bb0aff2127d702d0eadf19188 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 14 Jun 2005 10:41:00 +0000 Subject: [PATCH] Returns TreePanel when opening Newick --- src/jalview/gui/AlignFrame.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 5c31931..ad350cc 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -115,7 +115,7 @@ public class AlignFrame } String choice = chooser.getSelectedFile().getPath(); - Jalview2XML.SaveState(this, choice, shortName); + Jalview2XML.SaveAlignment(this, choice, shortName); // USE Jalview2XML to save this file return; @@ -1236,7 +1236,6 @@ public class AlignFrame void NewTreePanel(String type, String pwType, String title) { - String ltitle; final TreePanel tp; if ( (viewport.getSelectionGroup() != null) && @@ -1569,7 +1568,7 @@ public class AlignFrame { jalview.io.NewickFile fin = new jalview.io.NewickFile(choice, "File"); - ShowNewickTree(fin, choice); + viewport.setCurrentTree( ShowNewickTree(fin, choice).getTree() ); } catch (Exception ex) { @@ -1582,27 +1581,27 @@ public class AlignFrame } } - public void ShowNewickTree(NewickFile nf, String title) + public TreePanel ShowNewickTree(NewickFile nf, String title) { + TreePanel tp = null; try { nf.parse(); - if (nf.getTree() != null) { - TreePanel tp = new TreePanel(viewport, + tp = new TreePanel(viewport, viewport.getAlignment().getSequences(), nf, "FromFile", title); Desktop.addInternalFrame(tp, title, 600, 500); addTreeMenuItem(tp, title); - viewport.setCurrentTree(tp.getTree()); } } catch (Exception ex) { ex.printStackTrace(); } + return tp; } class PrintThread -- 1.7.10.2