From: kjvdheide Date: Mon, 27 Nov 2017 16:20:14 +0000 (+0000) Subject: JAL-2844 line drawing at mouse click added on top of Aptx X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=98b3b695032b6af0c35443044b6d3d00390b3c22;p=jalview.git JAL-2844 line drawing at mouse click added on top of Aptx --- diff --git a/src/jalview/ext/archaeopteryx/JalviewBinding.java b/src/jalview/ext/archaeopteryx/JalviewBinding.java index f59bdd9..2331204 100644 --- a/src/jalview/ext/archaeopteryx/JalviewBinding.java +++ b/src/jalview/ext/archaeopteryx/JalviewBinding.java @@ -13,6 +13,7 @@ import jalview.structure.StructureSelectionManager; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; +import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; @@ -159,11 +160,11 @@ public final class JalviewBinding } else { - partitionTree(e); - - + partitionTree(e.getX()); + } + PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); } }); @@ -221,28 +222,27 @@ public final class JalviewBinding /** * Partially refactored from TreeCanvas */ - public void partitionTree(final MouseEvent e) + public void partitionTree(final int x) { - int x = e.getX(); - int lineLength = treeView.getHeight(); - Phylogeny tree = treeView.getPhylogeny(); - double treeHeight = tree.calculateHeight(true); - - - - if (treeHeight != 0) + if (!tree.isEmpty()) { - int viewWidth = treeView.getWidth(); + double treeDepth = tree.calculateHeight(true); + if (treeDepth != 0) + { + Graphics g = treeView.getGraphics(); + int panelHeight = treeView.getHeight(); + g.drawLine(x, 0, x, panelHeight); - // treeView.validate(); - // System.out.println("selection"); - // System.out.println(x); - // System.out.println("-------------"); - // System.out.println("width"); - // System.out.println(viewWidth); + // int viewWidth = treeView.getWidth(); + // System.out.println("selection"); + // System.out.println(x); + // System.out.println("-------------"); + // System.out.println("width"); + // System.out.println(viewWidth); + } } @@ -267,7 +267,7 @@ public final class JalviewBinding showMatchingSequence(node); } - PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId()); + }