Returns the path for the node at the specified location. @param x an integer giving the number of pixels horizontally from the left edge of the display area, minus any left margin @param y an integer giving the number of pixels vertically from the top of the display area, minus an
(int x, int y)
| 2267 | * @return the <code>TreePath</code> for the node at that location |
| 2268 | */ |
| 2269 | public TreePath getPathForLocation(int x, int y) { |
| 2270 | TreePath closestPath = getClosestPathForLocation(x, y); |
| 2271 | |
| 2272 | if(closestPath != null) { |
| 2273 | Rectangle pathBounds = getPathBounds(closestPath); |
| 2274 | |
| 2275 | if(pathBounds != null && |
| 2276 | x >= pathBounds.x && x < (pathBounds.x + pathBounds.width) && |
| 2277 | y >= pathBounds.y && y < (pathBounds.y + pathBounds.height)) |
| 2278 | return closestPath; |
| 2279 | } |
| 2280 | return null; |
| 2281 | } |
| 2282 | |
| 2283 | /** |
| 2284 | * Returns the row for the specified location. |
no test coverage detected