public JFXProgressBarSkin(JFXProgressBar bar) { super(bar); bar.widthProperty().addListener(observable -> { updateProgress(); updateSecondaryProgress(); }); registerChangeListener(bar.secondaryProgressProperty(), "SECONDARY_PROGRESS"); registerChangeListener(bar.visibleProperty(), "VISIBLE"); registerChangeListener(bar.parentProperty(), "PARENT"); registerChangeListener(bar.sceneProperty(), "SCENE"); getSkinnable().requestLayout(); }
private void initialize() { setPrefWidth(200); getStyleClass().add(DEFAULT_STYLE_CLASS); }
protected void updateSecondaryProgress() { final JFXProgressBar control = (JFXProgressBar) getSkinnable(); secondaryBarWidth = ((int) (control.getWidth() - snappedLeftInset() - snappedRightInset()) * 2 * Math.min(1, Math.max(0, control.getSecondaryProgress()))) / 2.0F; control.requestLayout(); }
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(); }
cssBar.setProgress(-1.0f); JFXProgressBar jfxBar = new JFXProgressBar(); jfxBar.setPrefWidth(500); JFXProgressBar jfxBarInf = new JFXProgressBar(); jfxBarInf.setPrefWidth(500); jfxBarInf.setProgress(-1.0f); Duration.ZERO, new KeyValue(bar.progressProperty(), 0), new KeyValue(jfxBar.secondaryProgressProperty(), 0), new KeyValue(jfxBar.progressProperty(), 0)), new KeyFrame( Duration.seconds(1), new KeyValue(jfxBar.secondaryProgressProperty(), 1)), new KeyFrame( Duration.seconds(2), new KeyValue(bar.progressProperty(), 1), new KeyValue(jfxBar.progressProperty(), 1)));
/** * 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(); }
public void setSecondaryProgress(double secondaryProgress) { secondaryProgressProperty().set(secondaryProgress); } }
/** * {@inheritDoc} */ public JFXProgressBar() { initialize(); }
public void setSecondaryProgress(double secondaryProgress) { secondaryProgressProperty().set(secondaryProgress); } }
/** * {@inheritDoc} */ public JFXProgressBar(double progress) { super(progress); initialize(); }
protected void updateSecondaryProgress() { final JFXProgressBar control = (JFXProgressBar) getSkinnable(); secondaryBarWidth = ((int) (control.getWidth() - snappedLeftInset() - snappedRightInset()) * 2 * Math.min(1, Math.max(0, control.getSecondaryProgress()))) / 2.0F; control.requestLayout(); }
private void initialize() { setPrefWidth(200); getStyleClass().add(DEFAULT_STYLE_CLASS); }
/** * {@inheritDoc} */ public JFXProgressBar() { initialize(); }
/** * {@inheritDoc} */ public JFXProgressBar(double progress) { super(progress); initialize(); }