JAL-2844 mouse press code rearranged to prepare for tree partitioning
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 22 Nov 2017 14:06:25 +0000 (14:06 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Wed, 22 Nov 2017 14:06:25 +0000 (14:06 +0000)
src/jalview/ext/archaeopteryx/JalviewBinding.java
src/jalview/ext/treeviewer/ExternalTreeViewerBindingI.java

index 3f69299..53078cf 100644 (file)
@@ -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
       }
 
     }
-  }
+
 
 
 
index 57b71f2..a4ec9b2 100644 (file)
@@ -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<N>
    * 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);