List of usage examples for javafx.scene Scene getY
public final double getY()
From source file:com.eviware.loadui.ui.fx.util.NodeUtils.java
public static Rectangle2D localToScreen(Node node, Scene scene) { Bounds selectableBounds = node.localToScene(node.getBoundsInLocal()); return new Rectangle2D(selectableBounds.getMinX() + scene.getX() + scene.getWindow().getX(), selectableBounds.getMinY() + scene.getY() + scene.getWindow().getY(), node.getBoundsInLocal().getWidth(), node.getBoundsInLocal().getHeight()); }
From source file:org.pdfsam.ui.selection.LoadingStatusIndicator.java
/** * Show a password request right below the wrapped Control *///from w ww. j a v a 2s. c om public void showPasswordRequest() { Scene scene = this.getScene(); if (scene != null) { Window owner = scene.getWindow(); if (owner != null && owner.isShowing()) { Point2D nodeCoord = this.localToScene(this.getWidth() / 2, this.getHeight() / 1.5); double anchorX = Math.round(owner.getX() + scene.getX() + nodeCoord.getX() + 2); double anchorY = Math.round(owner.getY() + scene.getY() + nodeCoord.getY() + 2); popup.showFor(descriptorProvider.getPdfDocumentDescriptor(), this, anchorX, anchorY); } } }
From source file:ua.com.ecotep.debtprevention.VnaklController.java
@FXML private void handleDocSelectorAction(ActionEvent event) { if (selCl == null) { AlertDialog.showSimpleMessage("? .", AlertDialog.ICON_INFO, parentInterface.getCurrentWindow()); return;//from w ww . j a v a 2s .com } Task<Object> task = DPSession.getInstance().getTask(); if ((task != null) && (task.isRunning())) { AlertDialog.showSimpleMessage( "? ?, -? .", AlertDialog.ICON_FORBIDDEN, parentInterface.getCurrentWindow()); return; } Scene sceneParent = parentInterface.getCurrentWindow().getScene(); final Point2D windowCoord = new Point2D(sceneParent.getWindow().getX(), sceneParent.getWindow().getY()); final Point2D sceneCoord = new Point2D(sceneParent.getX(), sceneParent.getY()); final Point2D nodeCoord = addDocButton.localToScene(0.0, 0.0); final double coordX = Math.round(windowCoord.getX() + sceneCoord.getX() + nodeCoord.getX()); final double coordY = Math .round(windowCoord.getY() + sceneCoord.getY() + nodeCoord.getY() + addDocButton.getHeight() + 6); try { selectorPopup = new Popup(); selectorPopup.setAutoHide(true); selectorPopup.setAutoFix(true); selectorPopup.setHideOnEscape(true); FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("/fxml/DocSelectScene.fxml")); AnchorPane root = (AnchorPane) loader.load(); DocSelectController controller = loader.getController(); controller.setParentInterface(this); Scene scene = new Scene(root); scene.setFill(null); selectorPopup.getContent().add(root); selectorPopup.setX(coordX); selectorPopup.setY(coordY); selectorPopup.show(parentInterface.getCurrentWindow()); } catch (IOException ex) { Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex); AlertDialog.showSimpleMessage( "? ? !", AlertDialog.ICON_ERROR, parentInterface.getCurrentWindow()); } }