MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getPathForLocation

Method getPathForLocation

unused/javax/swing/JTree.java:2269–2281  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 8

getRowForLocationMethod · 0.95
mouseMovedMethod · 0.80
mouseClickedMethod · 0.80
handleMousePressedMethod · 0.80
handleMousePressedMethod · 0.80
mousePressedMethod · 0.80
mouseClickedMethod · 0.80
mouseClickedMethod · 0.80

Calls 2

getPathBoundsMethod · 0.95

Tested by

no test coverage detected