Search in sources :

Example 1 with ProgressIndicator

use of javafx.scene.control.ProgressIndicator in project POL-POM-5 by PhoenicisOrg.

the class StepRepresentationSpin method drawStepContent.

@Override
protected void drawStepContent() {
    super.drawStepContent();
    Region spacerAbove = new Region();
    VBox.setVgrow(spacerAbove, Priority.ALWAYS);
    this.addToContentPane(spacerAbove);
    ProgressIndicator progressIndicator = new ProgressIndicator();
    this.addToContentPane(progressIndicator);
    Region spacerBelow = new Region();
    VBox.setVgrow(spacerBelow, Priority.ALWAYS);
    this.addToContentPane(spacerBelow);
}
Also used : ProgressIndicator(javafx.scene.control.ProgressIndicator) Region(javafx.scene.layout.Region)

Example 2 with ProgressIndicator

use of javafx.scene.control.ProgressIndicator in project honest-profiler by jvm-profiling-tools.

the class FxUtil method getProgressIndicator.

/**
 * Returns an indeterminate {@link ProgressIndicator} with the specified dimensions.
 * <p>
 * @param maxWidth the maximum width of the {@link ProgressIndicator}
 * @param maxHeight the maximum height of the {@link ProgressIndicator}
 * @return the created {@link ProgressIndicator}
 */
public static ProgressIndicator getProgressIndicator(double maxWidth, double maxHeight) {
    ProgressIndicator progress = new ProgressIndicator();
    progress.setMaxSize(maxWidth, maxHeight);
    return progress;
}
Also used : ProgressIndicator(javafx.scene.control.ProgressIndicator)

Example 3 with ProgressIndicator

use of javafx.scene.control.ProgressIndicator in project phoenicis by PhoenicisOrg.

the class StepRepresentationSpin method drawStepContent.

@Override
protected void drawStepContent() {
    super.drawStepContent();
    Region spacerAbove = new Region();
    VBox.setVgrow(spacerAbove, Priority.ALWAYS);
    this.addToContentPane(spacerAbove);
    ProgressIndicator progressIndicator = new ProgressIndicator();
    this.addToContentPane(progressIndicator);
    Region spacerBelow = new Region();
    VBox.setVgrow(spacerBelow, Priority.ALWAYS);
    this.addToContentPane(spacerBelow);
}
Also used : ProgressIndicator(javafx.scene.control.ProgressIndicator) Region(javafx.scene.layout.Region)

Example 4 with ProgressIndicator

use of javafx.scene.control.ProgressIndicator in project kanonizo by kanonizo.

the class KanonizoFrame method addErrors.

private void addErrors(Object alg) {
    if (alg instanceof SearchAlgorithm) {
        bottom.getChildren().removeAll(activeErrors);
        activeErrors.clear();
        ProgressIndicator p = new ProgressIndicator();
        List<Method> prerequisites = Framework.getPrerequisites((SearchAlgorithm) alg);
        Task<Void> task = new Task<Void>() {

            @Override
            protected Void call() throws Exception {
                boolean anyFail = false;
                int row = 2;
                // run all prerequisites, not terminating on first failure
                for (int i = 0; i < prerequisites.size(); i++) {
                    Method requirement = prerequisites.get(i);
                    try {
                        boolean passed = (boolean) requirement.invoke(null, null);
                        if (!passed) {
                            anyFail = true;
                            // find readable error message
                            String error = requirement.getAnnotation(Prerequisite.class).failureMessage();
                            Label er = new Label(error);
                            activeErrors.add(er);
                            // css styling to make errors red
                            er.getStyleClass().add("error");
                            int errorRow = row++;
                            Platform.runLater(() -> bottom.add(er, 0, errorRow, 2, 1));
                        }
                    } catch (InvocationTargetException e) {
                        logger.error(e);
                    }
                }
                // if any pre-requisite failed, we can't run the algorithm
                if (anyFail && !goButton.isDisabled()) {
                    goButton.setDisable(true);
                } else if (!anyFail) {
                    goButton.setDisable(false);
                }
                return null;
            }
        };
        // show progress indicator over original layout
        VBox box = new VBox(p);
        box.setAlignment(Pos.CENTER);
        task.setOnSucceeded(e -> {
            mainLayout.getChildren().remove(box);
            borderPane.setDisable(false);
        });
        mainLayout.getChildren().add(box);
        borderPane.setDisable(true);
        new Thread(task).start();
    }
}
Also used : Task(javafx.concurrent.Task) SearchAlgorithm(org.kanonizo.algorithms.SearchAlgorithm) Label(javafx.scene.control.Label) Method(java.lang.reflect.Method) InvocationTargetException(java.lang.reflect.InvocationTargetException) ProgressIndicator(javafx.scene.control.ProgressIndicator) VBox(javafx.scene.layout.VBox) Prerequisite(org.kanonizo.annotations.Prerequisite)

Example 5 with ProgressIndicator

use of javafx.scene.control.ProgressIndicator in project dwoss by gg-net.

the class ClientView method initFxComponents.

private void initFxComponents() {
    try {
        progressIndicator = new ProgressIndicator();
        progressIndicator.setProgress(0);
        BorderPane pane = new BorderPane(progressIndicator);
        JFXPanel wrap = SwingCore.wrap(pane);
        extraProgressPanel.add(wrap, BorderLayout.CENTER);
    } catch (InterruptedException ex) {
        Ui.handle(ex);
    }
}
Also used : JFXPanel(javafx.embed.swing.JFXPanel) ProgressIndicator(javafx.scene.control.ProgressIndicator)

Aggregations

ProgressIndicator (javafx.scene.control.ProgressIndicator)11 Region (javafx.scene.layout.Region)3 HBox (javafx.scene.layout.HBox)2 FxThread (com.cas.sim.tis.anno.FxThread)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 KeyFrame (javafx.animation.KeyFrame)1 KeyValue (javafx.animation.KeyValue)1 Timeline (javafx.animation.Timeline)1 Task (javafx.concurrent.Task)1 JFXPanel (javafx.embed.swing.JFXPanel)1 Label (javafx.scene.control.Label)1 StackPane (javafx.scene.layout.StackPane)1 VBox (javafx.scene.layout.VBox)1 WebView (javafx.scene.web.WebView)1 SearchAlgorithm (org.kanonizo.algorithms.SearchAlgorithm)1 Prerequisite (org.kanonizo.annotations.Prerequisite)1