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;
}
else
{
- partitionTree(e);
-
-
+ partitionTree(e.getX());
+
}
+ PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
}
});
/**
* 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);
+ }
}
showMatchingSequence(node);
}
- PaintRefresher.Refresh(treeView, parentAvport.getSequenceSetId());
+
}