public void mouseEvent(MouseEvent e, Point screen, Point model)
{
mousePt.setLocation(screen);
pt.setLocation(screen);
Tool t = EventManager.instance.getToolManager().getCurrentTool();
if (t == null)
return;
if (PhyloWidget.ui.context.isOpen())
return;
if (getCurRange() == null)
return;
if (FocusManager.instance.getFocusedObject() != null)
return;
PhyloWidget.trees.getRenderer().setMouseLocation(pt);
setCurRange(getNearestNode((float) pt.getX(), (float) pt.getY()));
boolean containsPoint = containsPoint(getCurRange(), pt);
switch (e.getID())
{
case (MouseEvent.MOUSE_MOVED):
case (MouseEvent.MOUSE_DRAGGED):
PhyloTree tree = (PhyloTree) PhyloWidget.trees.getTree();
if (containsPoint && t.respondToOtherEvents())
{
UIUtils.setCursor(this, p, Cursor.HAND_CURSOR);
tree.setHoveredNode(getCurRange().node);
} else
{
UIUtils.releaseCursor(this, p);
tree.setHoveredNode(null);
}
break;
case (MouseEvent.MOUSE_PRESSED):
if (containsPoint && t.respondToOtherEvents())
{
openContextMenu();
isGlowing = false;
}
break;
}
if (!t.respondToOtherEvents())
{
PhyloTree tree = (PhyloTree) PhyloWidget.trees.getTree();
tree.setHoveredNode(null);
setCurRange(null);
}