public NetworkSyncPane() { networkSyncInfoLabel = new Label(); networkSyncInfoLabel.setText("Synchronize with network..."); networkSyncProgressBar = new ProgressBar(); networkSyncProgressBar.setPrefWidth(200); networkSyncProgressBar.setProgress(-1); getChildren().addAll(new HSpacer(5), networkSyncProgressBar, networkSyncInfoLabel); }
public void downloadComplete() { networkSyncInfoLabel.setText("Sync with network: Done"); networkSyncProgressBar.setProgress(1); FadeTransition fade = new FadeTransition(Duration.millis(700), this); fade.setToValue(0.0); fade.setCycleCount(1); fade.setInterpolator(Interpolator.EASE_BOTH); fade.play(); fade.setOnFinished(e -> getChildren().clear()); }
public void setProgress(double percent) { networkSyncProgressBar.setProgress(percent / 100.0); networkSyncInfoLabel.setText("Synchronize with network: " + (int) percent + "%"); }