Example usage for javax.swing JTree getPathBounds

List of usage examples for javax.swing JTree getPathBounds

Introduction

In this page you can find the example usage for javax.swing JTree getPathBounds.

Prototype

public Rectangle getPathBounds(TreePath path) 

Source Link

Document

Returns the Rectangle that the specified node will be drawn into.

Usage

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;
}