コード例 #1
0
  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);
  }
コード例 #2
0
  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());
  }
コード例 #3
0
 public void setProgress(double percent) {
   networkSyncProgressBar.setProgress(percent / 100.0);
   networkSyncInfoLabel.setText("Synchronize with network: " + (int) percent + "%");
 }