Example usage for javafx.scene Node sceneToLocal

List of usage examples for javafx.scene Node sceneToLocal

Introduction

In this page you can find the example usage for javafx.scene Node sceneToLocal.

Prototype

void sceneToLocal(com.sun.javafx.geom.Vec3d pt) throws NoninvertibleTransformException 

Source Link

Usage

From source file:com.eviware.loadui.ui.fx.util.NodeUtils.java

public static Node findFrontNodeAtCoordinate(Node root, Point2D point, Node... ignored) {
    if (!root.contains(root.sceneToLocal(point)) || !root.isVisible()) {
        return null;
    }/* w w  w. java  2s .  c  o m*/

    for (Node ignore : ignored) {
        if (isDescendant(ignore, root)) {
            return null;
        }
    }

    if (root instanceof Parent) {
        List<Node> children = ((Parent) root).getChildrenUnmodifiable();
        for (int i = children.size() - 1; i >= 0; i--) {
            Node result = findFrontNodeAtCoordinate(children.get(i), point, ignored);
            if (result != null) {
                return result;
            }
        }
    }

    return root;
}