How do I pause and resume using Timer ?
I followed your approach in http://tomasmikula.github.io/blog/2014/06/04/timers-in-javafx-and-reactfx.html
In javafx, I can do
Timeline autosaveTimer = new Timeline(
new KeyFrame(Duration.seconds(60 * MINUTES),
ae -> masterClock.setSaveSim(DEFAULT)));
At some point I have to call autosaveTimer().pause() to pause
and later call autosaveTimer().play() to resume
In ReactFX, I do the following
Timer autosaveTimer = FxTimer.runLater(
java.time.Duration.ofMinutes(60 * MINUTES),
() -> masterClock.setSaveSim(DEFAULT)));
I notice there is a stop() and restart() for Timer
but I don't want to stop autosaveTimer completely and restart from the beginning of MINUTES. I want to resume from whatever MINUTES has elapsed.
Is there a pause() and resume() that I can call ?
How do I pause and resume using Timer ?
I followed your approach in http://tomasmikula.github.io/blog/2014/06/04/timers-in-javafx-and-reactfx.html
In javafx, I can do
At some point I have to call
autosaveTimer().pause()to pauseand later call
autosaveTimer().play()to resumeIn ReactFX, I do the following
I notice there is a stop() and restart() for Timer
but I don't want to stop autosaveTimer completely and restart from the beginning of MINUTES. I want to resume from whatever MINUTES has elapsed.
Is there a pause() and resume() that I can call ?