JAL-2794 tree viewer frame now has its binding object properly set
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 17 Jan 2018 16:51:57 +0000 (16:51 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 17 Jan 2018 16:51:57 +0000 (16:51 +0000)
src/jalview/ext/archaeopteryx/JalviewBinding.java

index f7a5bfc..822f749 100644 (file)
@@ -116,6 +116,7 @@ public final class JalviewBinding
     treeView = archaeopteryx.getTreePanel();
     ssm = parentAvport.getStructureSelectionManager();
     
+    aptxFrame.setViewBinding(this);
     ssm.addSelectionListener(this);
     treeView.addMouseListener(this);
     treeView.registerWithPaintRefresher(
@@ -174,22 +175,21 @@ public final class JalviewBinding
 
     if (treeView.showingSubTree())
     {
-    LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
-            parentAvport.getAlignment().getSequencesArray(),
+      LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation(
+              parentAvport.getAlignment().getSequencesArray(),
               treeView.getTree());
-    bindAptxNodes.associateLeavesToSequences();
-    sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
-    nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
-    TreeViewerUtils.associateNodesWithJalviewSequences(aptxFrame, parentAvport,
-            sequencesBoundToNodes, nodesBoundToSequences);
+      bindAptxNodes.associateLeavesToSequences();
+      sequencesBoundToNodes = bindAptxNodes.getAlignmentWithNodes();
+      nodesBoundToSequences = bindAptxNodes.getNodesWithAlignment();
+      TreeViewerUtils.associateNodesWithJalviewSequences(aptxFrame,
+              parentAvport, sequencesBoundToNodes, nodesBoundToSequences);
 
-
-    for (SequenceI seq : parentAvport.getAlignment().getSequencesArray())
-    {
-      if (!sequencesBoundToNodes.containsKey(seq))
+      for (SequenceI seq : parentAvport.getAlignment().getSequencesArray())
       {
-        parentAvport.hideSequence(new SequenceI[] { seq });
-      }
+        if (!sequencesBoundToNodes.containsKey(seq))
+        {
+          parentAvport.hideSequence(new SequenceI[] { seq });
+        }
       }
     }
 
@@ -680,8 +680,6 @@ public final class JalviewBinding
   @Override
   public CommandI sortAlignmentIn(AlignmentPanel ap)
   {
-    // TODO: move to alignment view controller
-
     AlignmentViewport viewport = ap.av;
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
     try