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

Method getClosestPathForLocation

unused/javax/swing/JTree.java:2315–2321  ·  view source on GitHub ↗

Returns the path to the node that is closest to x,y. If no nodes are currently viewable, or there is no model, returns null , otherwise it always returns a valid path. To test if the node is exactly at x, y, get the node's bounds and test x, y against that. @param x an integer giving

(int x, int y)

Source from the content-addressed store, hash-verified

2313 * @see #getPathBounds
2314 */
2315 public TreePath getClosestPathForLocation(int x, int y) {
2316 TreeUI tree = getUI();
2317
2318 if(tree != null)
2319 return tree.getClosestPathForLocation(this, x, y);
2320 return null;
2321 }
2322
2323 /**
2324 * Returns the row to the node that is closest to x,y. If no nodes

Callers 3

getPathForLocationMethod · 0.95
getAccessibleAtMethod · 0.80

Calls 1

getUIMethod · 0.95

Tested by

no test coverage detected