List of usage examples for javafx.scene Node localToScene
public Bounds localToScene(Bounds localBounds, boolean rootScene)
From source file:Main.java
public void placeMarker(Node newNode) { double nodeMinX = newNode.getLayoutBounds().getMinX(); double nodeMinY = newNode.getLayoutBounds().getMinY(); Point2D nodeInScene = newNode.localToScene(nodeMinX, nodeMinY); Point2D nodeInMarkerLocal = marker.sceneToLocal(nodeInScene); Point2D nodeInMarkerParent = marker.localToParent(nodeInMarkerLocal); marker.relocate(nodeInMarkerParent.getX() + marker.getLayoutBounds().getMinX(), nodeInMarkerParent.getY() + marker.getLayoutBounds().getMinY()); }