From 8b86c7788d83dff23b86e83462a076fb778d49fe Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Wed, 17 Jan 2018 16:51:57 +0000 Subject: [PATCH] JAL-2794 tree viewer frame now has its binding object properly set --- src/jalview/ext/archaeopteryx/JalviewBinding.java | 28 ++++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index f7a5bfc..822f749 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -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 -- 1.7.10.2