From 0b008280ece80201c815ca4257556107012ee27e Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Thu, 11 Jan 2018 14:11:44 +0000 Subject: [PATCH] JAL-2884 old Newick trees are now loaded in as Aptx as well --- src/jalview/gui/Jalview2XML.java | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 4a15024..7c10544 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -37,10 +37,15 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.datamodel.StructureViewerModel; import jalview.datamodel.StructureViewerModel.StructureData; +import jalview.ext.archaeopteryx.AptxInit; +import jalview.ext.treeviewer.TreeFrameI; +import jalview.ext.treeviewer.TreeI; +import jalview.ext.treeviewer.TreeViewerUtils; import jalview.ext.varna.RnaModel; import jalview.gui.StructureViewer.ViewerType; import jalview.io.DataSourceType; import jalview.io.FileFormat; +import jalview.io.NewickFile; import jalview.renderer.ResidueShaderI; import jalview.schemabinding.version2.AlcodMap; import jalview.schemabinding.version2.AlcodonFrame; @@ -1095,9 +1100,24 @@ public class Jalview2XML jms.addTree(tree); } } + } } } + if (!storeDS && av.getCurrentExtTree() != null) + { + Set externalTreeViews = TreeViewerUtils + .getActiveTreeViews() + .keySet(); + for (TreeFrameI treeView : externalTreeViews) + { + TreeI tree = treeView.getTree(); + // tree.writeToJalviewProject(outputFile); + + } + + } + // SAVE ANNOTATIONS /** @@ -3653,12 +3673,20 @@ public class Jalview2XML { Tree tree = jms.getTree(t); + NewickFile newick = new jalview.io.NewickFile(tree.getNewick()); + + TreeFrameI externalViewer = AptxInit.createInstanceFromNhx( + tree.getTitle(), tree.getNewick(), + av); + TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId()); if (tp == null) { + + tp = af.showNewickTree( - new jalview.io.NewickFile(tree.getNewick()), + newick, tree.getTitle(), tree.getWidth(), tree.getHeight(), tree.getXpos(), tree.getYpos()); if (tree.getId() != null) @@ -5333,7 +5361,7 @@ public class Jalview2XML if (this.frefedSequence == null) { - frefedSequence = new Vector(); + frefedSequence = new Vector<>(); } viewportsAdded.clear(); -- 1.7.10.2