From: kjvdheide Date: Fri, 10 Nov 2017 13:38:33 +0000 (+0000) Subject: JAL-2794 comments, selected node now doesn't have to be external per se X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=efbac0c57e4f0cfed3ff952606afe5d3009f4e86;p=jalview.git JAL-2794 comments, selected node now doesn't have to be external per se --- diff --git a/src/jalview/ext/archaeopteryx/JalviewAptxBinding.java b/src/jalview/ext/archaeopteryx/JalviewAptxBinding.java index a3bff2d..755828d 100644 --- a/src/jalview/ext/archaeopteryx/JalviewAptxBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewAptxBinding.java @@ -48,20 +48,17 @@ public class JalviewAptxBinding implements JalviewTreeViewerBindingI @Override public void actionPerformed(ActionEvent e) { - } @Override public void mouseClicked(MouseEvent e) { - } @Override public void mousePressed(MouseEvent e) { showNodeSelectionOnAlign(e); - } @Override @@ -72,13 +69,11 @@ public class JalviewAptxBinding implements JalviewTreeViewerBindingI @Override public void mouseEntered(MouseEvent e) { - } @Override public void mouseExited(MouseEvent e) { - } @Override @@ -91,9 +86,9 @@ public class JalviewAptxBinding implements JalviewTreeViewerBindingI treeView.setFoundNodes0( new HashSet(seqsel.getSequences().size())); - for (SequenceI sequence : seqsel.getSequences()) + for (SequenceI selectedSequence : seqsel.getSequences()) { - PhylogenyNode matchingNode = sequencesBoundToNodes.get(sequence); + PhylogenyNode matchingNode = sequencesBoundToNodes.get(selectedSequence); if (matchingNode != null) { treeView.getFoundNodes0().add(matchingNode.getId()); @@ -107,33 +102,41 @@ public class JalviewAptxBinding implements JalviewTreeViewerBindingI } + /** + * Note that this currently only checks external nodes + */ @Override public void showNodeSelectionOnAlign(MouseEvent e) { final PhylogenyNode node = treeView.findNode(e.getX(), e.getY()); - if (node != null && node.isExternal()) + if (node != null) { SequenceI matchingSequence = nodesBoundToSequences.get(node); - - if ((e.getModifiers() & InputEvent.SHIFT_MASK) != 0) // shift is pressed - // (so multiple nodes - // can be selected) + if (matchingSequence != null) { - } - else - { - parentAvport.setSelectionGroup(null); // reset selection if shift isn't - // pressed - } + if ((e.getModifiers() & InputEvent.SHIFT_MASK) != 0) // shift is pressed + // (so multiple nodes + // can be selected) + { + // something? + + } + else + { + parentAvport.setSelectionGroup(null); // reset selection if shift + // isn't + // pressed + } - treeSelectionChanged(matchingSequence); - parentAvport.sendSelection(); // not actually needed? + treeSelectionChanged(matchingSequence); + parentAvport.sendSelection(); // not actually needed? - PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); + PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); + } } - } + } /** * Refactored from TreeCanvas