/** * init fxml when loaded. */ @PostConstruct public void init() { Timeline task = new Timeline( new KeyFrame( Duration.ZERO, new KeyValue(progress1.progressProperty(), 0), new KeyValue(progress2.progressProperty(), 0), new KeyValue(progress2.secondaryProgressProperty(), 0.5)), new KeyFrame( Duration.seconds(1), new KeyValue(progress2.secondaryProgressProperty(), 1)), new KeyFrame( Duration.seconds(2), new KeyValue(progress1.progressProperty(), 1), new KeyValue(progress2.progressProperty(), 1))); task.setCycleCount(Timeline.INDEFINITE); task.play(); }
new KeyValue(bar.progressProperty(), 0), new KeyValue(jfxBar.secondaryProgressProperty(), 0), new KeyValue(jfxBar.progressProperty(), 0)), new KeyFrame( Duration.seconds(1), Duration.seconds(2), new KeyValue(bar.progressProperty(), 1), new KeyValue(jfxBar.progressProperty(), 1)));
public JFXProgressBarSkin(JFXProgressBar bar) { super(bar); bar.widthProperty().addListener(observable -> { updateProgress(); updateSecondaryProgress(); }); registerChangeListener(bar.progressProperty(), (obs) -> updateProgress()); registerChangeListener(bar.secondaryProgressProperty(), obs-> updateSecondaryProgress()); registerChangeListener(bar.visibleProperty(), obs->updateAnimation()); registerChangeListener(bar.parentProperty(), obs->updateAnimation()); registerChangeListener(bar.sceneProperty(), obs->updateAnimation()); unregisterChangeListeners(NodeHelper.treeShowingProperty(bar)); unregisterChangeListeners(bar.indeterminateProperty()); registerChangeListener(NodeHelper.treeShowingProperty(bar), obs -> this.updateAnimation()); registerChangeListener(bar.indeterminateProperty(), obs->initialize()); initialize(); getSkinnable().requestLayout(); }