Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I have implemented this example from Intro To Java Programming - Liang. The animation is reversing direction on me, but it should not be doing that. It has a button to pause the animation, and a label to display the current rate. Here's what I do that causes the problem:
1. Press the Pause button
2. Change the rate (using the arrow keys)
3. Press the Pause button (this resumes the animation)
4. Change the rate again - this causes the direction to reverse!
The rate is always set to a positive value. When the animation reverses, I notice that currentRateProperty has become negative. It is a read-only property, and nothing I do can make it positive again.
I'm not sure if changing the rate of a running animation is a supported feature or not. The animation documentation doesn't say that you can't do it, but there are similar restrictions on Timelines that you can't change keyframes of executing timelines, so maybe changing the rate of a running animation is something that you shouldn't do either. I suggest you file a bug report in the JavaFX issue tracker to have somebody investigate.
Your sample seems to work if you stop the animation before you make the rate change and then start it again (from where its previous progress position) after the rate change has been made:
Get me the mayor's office! I need to tell him about this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss