@SuppressWarnings( "deprecation" ) public static List<Window> getWindows() { return Lists.reverse( Lists.newArrayList( Window.impl_getWindows() ) ); }
@SuppressWarnings("deprecated") public static List<Window> getWindows() { List<Window> windows = new ArrayList<>(); Window.impl_getWindows().forEachRemaining(windows::add); Collections.reverse(windows); return windows; }
Iterator<Window> impl_getWindows = Window.impl_getWindows();
/** * 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; }