JAL-2805 functional binding on loading associated trees
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 15 Nov 2017 10:39:47 +0000 (10:39 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 15 Nov 2017 10:39:47 +0000 (10:39 +0000)
src/jalview/ext/forester/io/ForesterTreeParser.java
src/jalview/gui/TreePanel.java

index 4e21b9d..85960e0 100644 (file)
@@ -1,5 +1,7 @@
 package jalview.ext.forester.io;
 
+import jalview.ext.archaeopteryx.AptxBinding;
+import jalview.ext.archaeopteryx.AptxNodeAssociation;
 import jalview.ext.archaeopteryx.ArchaeopteryxInit;
 import jalview.gui.Desktop;
 import jalview.gui.JvOptionPane;
@@ -55,7 +57,17 @@ public class ForesterTreeParser implements ExternalTreeParserI<MainFrame>
     String[] AptxArgs = new String[] { "-c",
         "_aptx_jalview_configuration_file", filePath };
     MainFrame aptx = Archaeopteryx.main(AptxArgs);
+
+    AptxNodeAssociation bindAptxNodes = new AptxNodeAssociation(
+            viewport.getAlignment().getSequencesArray(),
+            aptx.getMainPanel().getCurrentTreePanel().getPhylogeny());
+
+    bindAptxNodes.associateLeavesToSequences();
+    new AptxBinding(aptx, viewport, bindAptxNodes.getAlignmentWithNodes(),
+            bindAptxNodes.getNodesWithAlignment());
+
     ArchaeopteryxInit.bindFrameToJalview(aptx);
+
     return aptx;
 
 
index 55e3a1b..e8f78d8 100755 (executable)
@@ -519,7 +519,7 @@ public void buildTreeCanvas(AlignmentPanel ap) {
    * @param e
    */
   @Override
-  public void sortByTree_actionPerformed()
+  public void sortByTree_actionPerformed()// modify for Aptx
   {
 
     if (treeCanvas.applyToAllViews)