Package javafx.stage

Examples of javafx.stage.Stage


   *            a mouse event handler for the message
   */
  private void showNotificationInternal(final String message,
      final EventHandler<MouseEvent> mouseEventHandler) {
    if (notifyPopup == null) {
      notifyPopup = new Stage(StageStyle.TRANSPARENT);
      notifyPopup.initOwner(systemTray.dummyPopup);
      notifyPopup.initModality(Modality.WINDOW_MODAL);
      // notifyPopup.focusedProperty().addListener(new
      // ChangeListener<Boolean>() {
      // @Override
View Full Code Here


      return;
    }
    log.debug("Minimizing application to system tray");
    if (dummyPopup == null) {
      // javafx.stage.Popup does not work
      dummyPopup = new Stage();
      final Screen screen = Screen.getPrimary();
      final Rectangle2D bounds = screen.getVisualBounds();
      dummyPopup.initModality(Modality.NONE);
      dummyPopup.initStyle(StageStyle.UTILITY);
      dummyPopup.setOpacity(0d);
View Full Code Here

    }
   
   
   
    public void createView(){
        this.dialogStage = new Stage();
        dialogStage.initModality(Modality.WINDOW_MODAL);
        Scene scene = new Scene(root);

        dialogStage.setScene(scene);
        dialogStage.setTitle("New Script");
View Full Code Here

 
  void afterAll(final File summeryFile){
    runInGuithreadAndWait(new Runnable() {
      @Override
      public void run() {
        Stage stage = new Stage();
        stage.setHeight(800);
        stage.setWidth(1024);
        final BorderPane borderPane = new BorderPane();
        final WebView webView = new WebView();
       
        try {
          webView.getEngine().load(
              summeryFile.toURI().toURL().toExternalForm());
        } catch (MalformedURLException e) {
          throw new RuntimeException(e);
        }
        webView.setStyle("-fx-font-smoothing-type: gray;");
        borderPane.setCenter(webView);
        final Button button = new Button("open report folder");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            try {
              Desktop.getDesktop().open(summeryFile.getParentFile());
            } catch (IOException e) {
              throw new RuntimeException(e);
            }
          }
        });
        HBox buttonbox= new HBox();
        buttonbox.getChildren().add(button);
        borderPane.setBottom(buttonbox);
        stage.setScene(new Scene(borderPane));
        stage.show();
        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
          @Override
          public void handle(WindowEvent event) {
            System.exit(0);
          }
        });
View Full Code Here

   *            the parent {@linkplain Stage} of the alert (should not be
   *            null)
   * @return the {@linkplain ProgressIndicator} alert
   */
  public static Stage alertProgress(final Stage parent) {
    final Stage alert = alert(parent, 200, 150,
        Modality.APPLICATION_MODAL, new ProgressIndicator());
    return alert;
  }
View Full Code Here

    final Lighting lighting = new Lighting();
    lighting.setSurfaceScale(1d);
    lighting.setLight(light);
    //final ProgressIndicator pi = ProgressIndicatorBuilder.create().maxWidth(200d).effect(lighting).build();
    final ProgressIndicator pi = ProgressBarBuilder.create().maxWidth(parent.getWidth() / 2d).maxHeight(25d).effect(lighting).build();
    final Stage alert = alert(parent, parent.getWidth(), parent.getHeight(), Modality.APPLICATION_MODAL, pi,
        LabelBuilder.create().text(RS.rbLabel(KEY.SENDING)).build());
    final Service<T> service = new Service<T>() {
      @Override
      protected Task<T> createTask() {
        return progressTask;
      }
    };
    final Effect origEffect = parent.getScene().getRoot().getEffect();
    progressTask.stateProperty().addListener(new ChangeListener<State>() {
      @Override
      public void changed(ObservableValue<? extends State> observable, State oldValue, State newValue) {
        if (newValue == State.RUNNING && !alert.isShowing()) {
          Platform.runLater(new Runnable() {
            public void run() {
              parent.getScene().getRoot().setEffect(ColorAdjustBuilder.create().brightness(-0.5d).build());
              alert.show();
            }
          });
        } else if (newValue == State.SUCCEEDED || newValue == State.FAILED || newValue == State.CANCELLED) {
          Platform.runLater(new Runnable() {
            public void run() {
              alert.hide();
              parent.getScene().getRoot().setEffect(origEffect);
            }
          });
        }
      }
View Full Code Here

   *            the children of the alert
   * @return the alert
   */
  public static Stage alert(final Stage parent, final double width, final double height,
      final Modality modality, final Node... children) {
    final Stage stage = new Stage();
    stage.initModality(modality);
    stage.initStyle(StageStyle.TRANSPARENT);
    final StackPane root = new StackPane();
    root.setPrefSize(width, height);
    if (children != null) {
      root.getChildren().addAll(children);
    }
    if (parent != null) {
      stage.setScene(new Scene(root, parent.getWidth(), parent.getHeight(), Color.TRANSPARENT));
      stage.initOwner(parent);
      stage.setX(parent.getX() + parent.getScene().getWidth() / 2d - width / 2d);
      stage.setY(parent.getY() + parent.getScene().getHeight() / 2d - height / 2d);
      parent.xProperty().addListener(new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
          stage.setX(newValue.doubleValue() + parent.getScene().getWidth() / 2d - width / 2d);
        }
      });
      parent.yProperty().addListener(new ChangeListener<Number>() {
        @Override
        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
          stage.setY(newValue.doubleValue() + parent.getScene().getHeight() / 2d - height / 2d);
        }
      });
    } else {
      stage.setScene(new Scene(root, width, height, Color.TRANSPARENT));
    }
    return stage;
  }
View Full Code Here

   * @return the {@linkplain DialogService}
   */
  public static DialogService dialogService(final Stage parent, final KEY titleKey, final String headerText,
      final KEY submitLabelKey, final double width, final double height, final Service<Void> submitService,
      final Modality modality, final Node... children) {
    final Stage window = new Stage();
    window.initModality(modality);
    final Button submitBtn = ButtonBuilder.create().text(RS.rbLabel(submitLabelKey == null ? KEY.SUBMIT :
      submitLabelKey)).defaultButton(true).onAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(final ActionEvent actionEvent) {
        submitService.restart();
View Full Code Here

                                };
                            }
                        });
                        listView.getItems().setAll(fxForm.getConstraintViolations());
                        Scene scene = new Scene(listView);
                        Stage stage = new Stage();
                        stage.setScene(scene);
                        stage.show();
                    }
                }).build();
    }
View Full Code Here

     * Cancels the create league process and closes the window.
     *
     * @param event the event
     */
    public void closeWindow(final ActionEvent event) {
        final Stage stage = (Stage) root.getScene().getWindow();
        stage.close();
    }
View Full Code Here

TOP

Related Classes of javafx.stage.Stage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.