List of usage examples for javafx.util Duration divide
@Deprecated
public Duration divide(Duration other)
From source file:MediaControl.java
protected void updateValues() { if (playTime != null && timeSlider != null && volumeSlider != null) { Platform.runLater(new Runnable() { public void run() { Duration currentTime = mp.getCurrentTime(); playTime.setText(formatTime(currentTime, duration)); timeSlider.setDisable(duration.isUnknown()); if (!timeSlider.isDisabled() && duration.greaterThan(Duration.ZERO) && !timeSlider.isValueChanging()) { timeSlider.setValue(currentTime.divide(duration).toMillis() * 100.0); }//from w w w . jav a 2 s. c o m if (!volumeSlider.isValueChanging()) { volumeSlider.setValue((int) Math.round(mp.getVolume() * 100)); } } }); } }