Example usage for javafx.scene.control ProgressIndicator setMinSize

List of usage examples for javafx.scene.control ProgressIndicator setMinSize

Introduction

In this page you can find the example usage for javafx.scene.control ProgressIndicator setMinSize.

Prototype

public void setMinSize(double minWidth, double minHeight) 

Source Link

Document

Convenience method for overriding the region's computed minimum width and height.

Usage

From source file:edu.wustl.lookingglass.issue.ExceptionPane.java

public final void submit() {
    assert javafx.application.Platform.isFxApplicationThread();

    javafx.scene.control.ProgressIndicator indicator = new javafx.scene.control.ProgressIndicator(
            javafx.scene.control.ProgressIndicator.INDETERMINATE_PROGRESS);
    indicator.setPrefSize(100, 100);/* ww  w . ja v  a  2 s  .  c o  m*/
    indicator.setMinSize(javafx.scene.control.Control.USE_PREF_SIZE,
            javafx.scene.control.Control.USE_PREF_SIZE);
    indicator.setMaxSize(javafx.scene.control.Control.USE_PREF_SIZE,
            javafx.scene.control.Control.USE_PREF_SIZE);
    indicator.setStyle("-fx-progress-color: black;");

    getDialog().setAndShowOverlay(indicator);

    final BugReport report = this.generateReport();
    this.attachProject(report);

    // Do not use SwingWorker in Java FX.
    new Thread(() -> {
        try {
            uploadToRedmine(report);
        } catch (Throwable t) {
            Logger.throwable(t, report);
        }
        Platform.runLater(() -> {
            getDialog().close();
        });
    }).start();
}

From source file:org.beryx.viewreka.fxapp.ProjectLibs.java

public void installLibs(String prjName, File prjDir) {
    InstallLibsTask task = new InstallLibsTask(prjName, prjDir, lstLib);

    Stage progressStage = new Stage();
    progressStage.setOnCloseRequest(ev -> {
        if (Dialogs.confirmYesNo("Cancel",
                "Are you sure you want to cancel the installation of project libraries?", null)) {
            task.cancel();/* w  ww  .  ja v a2  s . co m*/
        }
    });
    progressStage.initStyle(StageStyle.UTILITY);
    progressStage.initModality(Modality.APPLICATION_MODAL);
    progressStage.setTitle("Create project " + prjName);

    GridPane grid = new GridPane();
    grid.setHgap(20);
    grid.setVgap(20);
    grid.setPadding(new Insets(24, 10, 0, 24));

    ProgressIndicator progressIndicator = new ProgressIndicator();
    progressIndicator.setPrefSize(64, 64);
    progressIndicator.setMinSize(64, 64);
    progressIndicator.setMaxSize(64, 64);
    //        progressIndicator.progressProperty().bind(task.progressProperty());
    grid.add(progressIndicator, 0, 0);

    Label actionLabel = new Label("Install project libraries...");
    actionLabel.textProperty().bind(task.messageProperty());
    grid.add(actionLabel, 1, 0);

    progressStage.setScene(new Scene(grid, 600, 120));

    task.setOnSucceeded(ev -> closeProgress(progressStage, task));
    task.setOnFailed(ev -> closeProgress(progressStage, task));
    task.setOnCancelled(ev -> closeProgress(progressStage, task));

    progressStage.setOnShown(ev -> Executors.newSingleThreadExecutor().submit(task));
    progressStage.showAndWait();
}