Search in sources :

Example 6 with ProgressBar

use of javafx.scene.control.ProgressBar in project JFoenix by jfoenixadmin.

the class ProgressBarDemo method start.

@Override
public void start(Stage stage) throws Exception {
    pane = new VBox();
    pane.setSpacing(30);
    pane.setStyle("-fx-background-color:WHITE");
    ProgressBar bar = new ProgressBar();
    bar.setPrefWidth(500);
    ProgressBar cssBar = new ProgressBar();
    cssBar.setPrefWidth(500);
    cssBar.setProgress(-1.0f);
    JFXProgressBar jfxBar = new JFXProgressBar();
    jfxBar.setPrefWidth(500);
    JFXProgressBar jfxBarInf = new JFXProgressBar();
    jfxBarInf.setPrefWidth(500);
    jfxBarInf.setProgress(-1.0f);
    Timeline timeline = new Timeline(new KeyFrame(Duration.ZERO, new KeyValue(bar.progressProperty(), 0), new KeyValue(jfxBar.progressProperty(), 0)), new KeyFrame(Duration.seconds(2), new KeyValue(bar.progressProperty(), 1), new KeyValue(jfxBar.progressProperty(), 1)));
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.play();
    pane.getChildren().addAll(bar, jfxBar, cssBar, jfxBarInf);
    StackPane main = new StackPane();
    main.getChildren().add(pane);
    main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
    StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
    final Scene scene = new Scene(main, 600, 200, Color.WHITE);
    scene.getStylesheets().add(ProgressBarDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX ProgressBar Demo ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) Insets(javafx.geometry.Insets) JFXProgressBar(com.jfoenix.controls.JFXProgressBar) KeyFrame(javafx.animation.KeyFrame) Scene(javafx.scene.Scene) JFXProgressBar(com.jfoenix.controls.JFXProgressBar) ProgressBar(javafx.scene.control.ProgressBar)

Example 7 with ProgressBar

use of javafx.scene.control.ProgressBar in project intellij-community by JetBrains.

the class StudyBrowserWindow method makeProgressBarWithListener.

private ProgressBar makeProgressBarWithListener() {
    final ProgressBar progress = new ProgressBar();
    progress.progressProperty().bind(myWebComponent.getEngine().getLoadWorker().progressProperty());
    myWebComponent.getEngine().getLoadWorker().stateProperty().addListener((ov, oldState, newState) -> {
        if (myWebComponent.getEngine().getLocation().contains("http") && newState == Worker.State.SUCCEEDED) {
            myProgressBar.setVisible(false);
            myWebComponent.setVisible(true);
        }
    });
    return progress;
}
Also used : ProgressBar(javafx.scene.control.ProgressBar)

Example 8 with ProgressBar

use of javafx.scene.control.ProgressBar in project Retrospector by NonlinearFruit.

the class Retrospector method init.

@Override
public void init() {
    ImageView splash = new ImageView(new Image(SPLASH_IMAGE, SPLASH_WIDTH, SPLASH_HEIGHT, true, true));
    loadProgress = new ProgressBar(0);
    loadProgress.setPrefWidth(SPLASH_WIDTH);
    progressText = new Label("Initializing . . .");
    progressText.setBackground(new Background(new BackgroundFill(Color.GHOSTWHITE, new CornerRadii(5), new Insets(0))));
    splashLayout = new VBox();
    splashLayout.getChildren().addAll(splash, loadProgress, progressText);
    progressText.setAlignment(Pos.CENTER);
    //        splashLayout.setEffect(new DropShadow());
    splashLayout.setBackground(Background.EMPTY);
}
Also used : Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) CornerRadii(javafx.scene.layout.CornerRadii) ProgressBar(javafx.scene.control.ProgressBar) VBox(javafx.scene.layout.VBox)

Example 9 with ProgressBar

use of javafx.scene.control.ProgressBar in project SmartCity-Market by TechnionYP5777.

the class EmployeeGuiPreloader method init.

@Override
public void init() throws Exception {
    System.out.println(EmployeeApplicationScreen.STEP() + "EmployeeGuiPreloader#init, thread: " + Thread.currentThread().getName());
    // If preloader has complex UI it's initialization can be done in
    // EmployeeApplicationScreen#init
    Platform.runLater(() -> {
        Label title = new Label("SmartMarket is loading\nplease wait...");
        title.setTextAlignment(TextAlignment.CENTER);
        progress = new ProgressBar();
        progress.setProgress(0);
        VBox root = new VBox(title, progress);
        root.setAlignment(Pos.CENTER);
        scene = new Scene(root, WIDTH, HEIGHT);
    });
}
Also used : Label(javafx.scene.control.Label) Scene(javafx.scene.Scene) ProgressBar(javafx.scene.control.ProgressBar) VBox(javafx.scene.layout.VBox)

Aggregations

ProgressBar (javafx.scene.control.ProgressBar)9 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 Tooltip (javafx.scene.control.Tooltip)3 VBox (javafx.scene.layout.VBox)3 Button (javafx.scene.control.Button)2 Label (javafx.scene.control.Label)2 ImageView (javafx.scene.image.ImageView)2 HBox (javafx.scene.layout.HBox)2 Text (javafx.scene.text.Text)2 AllIcons (com.intellij.icons.AllIcons)1 JFXProgressBar (com.jfoenix.controls.JFXProgressBar)1 java.awt (java.awt)1 BufferedImage (java.awt.image.BufferedImage)1 CookieHandler (java.net.CookieHandler)1 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 KeyFrame (javafx.animation.KeyFrame)1 KeyValue (javafx.animation.KeyValue)1