From: kjvdheide Date: Wed, 22 Nov 2017 14:06:25 +0000 (+0000) Subject: JAL-2844 mouse press code rearranged to prepare for tree partitioning X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8e278ff4061a10e807b857c92347be7034ee3c34;p=jalview.git JAL-2844 mouse press code rearranged to prepare for tree partitioning --- diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index 3f69299..53078cf 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -130,9 +130,23 @@ public final class JalviewBinding @Override public void mousePressed(final MouseEvent e) { - showNodeSelectionOnAlign(e); - } + final PhylogenyNode node = treeView.findNode(e.getX(), e.getY()); + if (node != null) + { + if ((e.getModifiers() & InputEvent.SHIFT_MASK) == 0) // clear previous + // selection if shift + // IS NOT pressed + { + parentAvport.setSelectionGroup(null); + } + showNodeSelectionOnAlign(node); + } + else + { + partitionTree(); + } + } @Override public void mouseReleased(MouseEvent e) { @@ -176,20 +190,15 @@ public final class JalviewBinding } + public void partitionTree() + { + + } + @Override - public void showNodeSelectionOnAlign(final MouseEvent e) + public void showNodeSelectionOnAlign(final PhylogenyNode node) { - final PhylogenyNode node = treeView.findNode(e.getX(), e.getY()); - if (node != null) - { - if ((e.getModifiers() & InputEvent.SHIFT_MASK) == 0) // clear previous - // selection if shift - // IS NOT pressed - { - parentAvport.setSelectionGroup(null); - } - if (node.isInternal()) { showMatchingChildSequences(node); @@ -201,7 +210,7 @@ public final class JalviewBinding } } - } + diff --git a/src/jalview/ext/treeviewer/ExternalTreeViewerBindingI.java b/src/jalview/ext/treeviewer/ExternalTreeViewerBindingI.java index 57b71f2..a4ec9b2 100644 --- a/src/jalview/ext/treeviewer/ExternalTreeViewerBindingI.java +++ b/src/jalview/ext/treeviewer/ExternalTreeViewerBindingI.java @@ -25,7 +25,6 @@ import jalview.structure.SelectionListener; import jalview.structure.SelectionSource; import java.awt.event.ActionListener; -import java.awt.event.MouseEvent; import java.awt.event.MouseListener; /** @@ -49,7 +48,7 @@ public interface ExternalTreeViewerBindingI * corresponding sequence in the Jalview alignment view. If an internal node * is selected all child sequences get highlighted as well. */ - public void showNodeSelectionOnAlign(MouseEvent e); + public void showNodeSelectionOnAlign(N node); public void treeSelectionChanged(SequenceI sequence);