From: kjvdheide Date: Tue, 12 Dec 2017 18:40:05 +0000 (+0000) Subject: JAL-2874 filtering alignment now also works when just zoomed in X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1609be17a03b3d9f200fc35c20c7f5c6f745ca67;p=jalview.git JAL-2874 filtering alignment now also works when just zoomed in --- diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index 11aab2b..0593217 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -25,6 +25,7 @@ import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; import java.awt.Color; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; @@ -177,6 +178,9 @@ public final class JalviewBinding @Override public void actionPerformed(ActionEvent e) { + // reset hidden sequences first + parentAvport.showAllHiddenSeqs(); + if (treeView.isCurrentTreeIsSubtree()) { LoadedTreeSequenceAssociation bindAptxNodes = new LoadedTreeSequenceAssociation( @@ -198,6 +202,25 @@ public final class JalviewBinding } } + else + { + + Rectangle visibleView = treeView.getVisibleRect(); + + for (PhylogenyNode node : PhylogenyMethods.getAllDescendants(treeView.getPhylogeny().getRoot())) { + if (!(node.getXcoord() > visibleView.getMinX() + && node.getXcoord() < visibleView.getMaxX() + && node.getYcoord() > visibleView.getMinY() + && node.getYcoord() < visibleView.getMaxY())) + { + parentAvport + .hideSequence(new SequenceI[] + { nodesBoundToSequences.get(node) }); + } + } + + } + }