List of usage examples for javax.swing JTree getPathBounds
public Rectangle getPathBounds(TreePath path)
Rectangle
that the specified node will be drawn into. From source file:org.openmicroscopy.shoola.agents.treeviewer.browser.BrowserUI.java
/** * Handles the mouse moved event. Displays the properties of the * the nodes the mouse is over./* www . j ava 2 s.co m*/ * * @param e The mouse event to handle. */ private void rollOver(MouseEvent e) { if (!model.getParentModel().isRollOver()) return; JTree tree = treeDisplay; TreePath path = treeDisplay.getClosestPathForLocation(e.getX(), e.getY()); Rectangle bounds = tree.getPathBounds(path); if (!bounds.contains(e.getPoint())) return; TreeImageDisplay node = (TreeImageDisplay) path.getLastPathComponent(); Object uo = node.getUserObject(); if (!(uo instanceof DataObject)) return; }