boolean isInsideStateIcon(Point2D point) { BoundingBox bounds = new BoundingBox(expandedStateLabel.getLayoutX(), expandedStateLabel.getLayoutY(), expandedStateLabel.getWidth(), expandedStateLabel.getHeight()); return bounds.contains(point); }
if (w != null && new BoundingBox(w.getX(), w.getY(), w.getWidth(), w.getHeight()).contains(screenX, screenY)) { return findNode(w.getScene().getRoot(), screenX, screenY); if (!FIND_NODE_EXCLUDE.equals(window.getUserData()) && new BoundingBox(window.getX(), window.getY(), window.getWidth(), window.getHeight()).contains(screenX, screenY)) { return findNode(window.getScene().getRoot(), screenX, screenY);
/** * Find a node in all windows * * @param w * the preferred window * @param screenX * the screen x * @param screenY * the screen y * @return the node or <code>null</code> */ @SuppressWarnings("deprecation") public static Node findNode(Window w, double screenX, double screenY) { // First check the owner if (new BoundingBox(w.getX(), w.getY(), w.getWidth(), w.getHeight()).contains(screenX, screenY)) { return findNode(w.getScene().getRoot(), screenX, screenY); } // FIXME If multiple match take the closest Iterator<Window> impl_getWindows = Window.impl_getWindows(); while (impl_getWindows.hasNext()) { Window window = impl_getWindows.next(); if (!FIND_NODE_EXCLUDE.equals(window.getUserData()) && new BoundingBox(window.getX(), window.getY(), window.getWidth(), window.getHeight()).contains(screenX, screenY)) { return findNode(window.getScene().getRoot(), screenX, screenY); } } return null; }