/** * Gets the tree path according to the mouse event. * * @param e the mouse event * @return the tree path the mouse is over. null if no tree node is under the mouse position. */ protected TreePath getTreePathForMouseEvent(MouseEvent e) { if (!SwingUtilities.isLeftMouseButton(e)) { return null; } if (!_tree.isCheckBoxEnabled()) { return null; } TreePath path = _tree.getPathForLocation(e.getX(), e.getY()); if (path == null) return null; if (clicksInCheckBox(e, path) || !_tree.isClickInCheckBoxOnly()) { return path; } else { return null; } }