コード例 #1
0
 // 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;
 }
コード例 #2
0
  /**
   * 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);
  }
コード例 #3
0
ファイル: Login.java プロジェクト: Gianlucator/Carloan-Tested
  @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");
    }
  }
コード例 #4
0
  @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) {
    }
  }
コード例 #5
0
 private void setUpdateNeeded(boolean value) {
   if (isAnimationTimerActive == false && value == true && node.getScene() != null) {
     startAnimationTimer();
   }
   this.updateNeeded = value;
 }
コード例 #6
0
 public static Window getParentWindow(Node node) {
   return node.getScene().getWindow();
 }
コード例 #7
0
ファイル: BoundsQueryUtils.java プロジェクト: TestFX/TestFX
 /**
  * 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());
 }
コード例 #8
0
 public void actionClose(ActionEvent actionEvent) {
   Node source = (Node) actionEvent.getSource();
   Stage stage = (Stage) source.getScene().getWindow();
   stage.hide();
 }