// as of JDK 1.6: @Override public int getScreenLocationY() { // this code is never called? Bounds lBoundsInScenenode = node.localToScene(node.getBoundsInLocal()); int v = (int) Math.ceil( node.getScene().getY() + node.getScene().getY() + lBoundsInScenenode.getMinY()); // for debugging System.out.println(getComponent() + " getScreenLocationX =" + v); return v; }
/** * Show this popup right below the given Node * * @param node */ public void show(Node node) { if (node.getScene() == null || node.getScene().getWindow() == null) throw new IllegalStateException( "Can not show popup. The node must be attached to a scene/window."); //$NON-NLS-1$ if (isShowing()) { return; } Window parent = node.getScene().getWindow(); this.show( parent, parent.getX() + node.localToScene(0, 0).getX() + node.getScene().getX(), parent.getY() + node.localToScene(0, 0).getY() + node.getScene().getY() + TITLE_HEIGHT); }
@FXML public void onLogin() { FrontController fController = CarloanFrontController.getInstance(); Operatore operatore = new Operatore(); operatore.setUsername(username.getText()); operatore.setPassword(password.getText()); if (fController.processRequest("Login", operatore) != null) { ((Stage) root.getScene().getWindow()).close(); fController.processRequest("MostraMainStage"); } }
@FXML private void volverMenuPrincipal(ActionEvent event) { try { // Cargamos la scene FXMLLoader loader = new FXMLLoader(); loader.setLocation(Principal.class.getResource("MenuGerente.fxml")); AnchorPane Gerente = (AnchorPane) loader.load(); // Agregamos a la ventana Scene scene = new Scene(Gerente); Node node = (Node) event.getSource(); Stage primaryStage = (Stage) node.getScene().getWindow(); primaryStage.setScene(scene); primaryStage.centerOnScreen(); primaryStage.setTitle("Menu Gerente"); primaryStage.show(); } catch (IOException e) { } }
private void setUpdateNeeded(boolean value) { if (isAnimationTimerActive == false && value == true && node.getScene() != null) { startAnimationTimer(); } this.updateNeeded = value; }
public static Window getParentWindow(Node node) { return node.getScene().getWindow(); }
/** * Retrieves the physical untransformed bounds (geom + effect + clip) of a Node before * transforming that to the screen's coordinate system. */ public static Bounds boundsOnScreen(Node node) { Bounds boundsInScene = nodeBoundsInScene(node); // Bounds visibleBoundsInScene = limitToVisibleBounds(boundsInScene, node.getScene()); return boundsOnScreen(boundsInScene, node.getScene()); }
public void actionClose(ActionEvent actionEvent) { Node source = (Node) actionEvent.getSource(); Stage stage = (Stage) source.getScene().getWindow(); stage.hide(); }