JAL-2884 old Newick trees are now loaded in as Aptx as well
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 11 Jan 2018 14:11:44 +0000 (14:11 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 11 Jan 2018 14:11:44 +0000 (14:11 +0000)
src/jalview/gui/Jalview2XML.java

index 4a15024..7c10544 100644 (file)
@@ -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<TreeFrameI> 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<SeqFref>();
+      frefedSequence = new Vector<>();
     }
 
     viewportsAdded.clear();