-
Bug
-
Resolution: Fixed
-
P3
-
fx1.0
-
Java FX 1.0.1 b02
JRE 6u10
Windows Vista SP1
When specifying repeatCount to be indefinite in a timeline,
the time value is not taken into account.
The following code:
===============================================
import javafx.animation.Timeline;
import javafx.lang.Duration.*;
import javafx.animation.KeyFrame;
var Number:Integer = 21;
var dur:Duration = 21s;
var timeline = Timeline{
//repeatCount: 5
repeatCount: Timeline.INDEFINITE
autoReverse: true
time: dur
keyFrames: [
at (0s) {Number => 0 },
at (26s) {Number => 26} ],
}
timeline.play();
var currentPlayHead = bind Number on replace {
println("Number change:");
println(Number);
}
===============================================
prints:
Number change:
0
Number change:
21
Number change:
0
Number change:
1
Number change:
2
Number change:
3
.....
But if repeatCount is set to 5, it would print:
Number change:
0
Number change:
21
Number change:
22
Number change:
23
Number change:
24
Number change:
25
Number change:
26
Number change:
25
Number change:
24
Number change:
23
...
the time value is not taken into account.
The following code:
===============================================
import javafx.animation.Timeline;
import javafx.lang.Duration.*;
import javafx.animation.KeyFrame;
var Number:Integer = 21;
var dur:Duration = 21s;
var timeline = Timeline{
//repeatCount: 5
repeatCount: Timeline.INDEFINITE
autoReverse: true
time: dur
keyFrames: [
at (0s) {Number => 0 },
at (26s) {Number => 26} ],
}
timeline.play();
var currentPlayHead = bind Number on replace {
println("Number change:");
println(Number);
}
===============================================
prints:
Number change:
0
Number change:
21
Number change:
0
Number change:
1
Number change:
2
Number change:
3
.....
But if repeatCount is set to 5, it would print:
Number change:
0
Number change:
21
Number change:
22
Number change:
23
Number change:
24
Number change:
25
Number change:
26
Number change:
25
Number change:
24
Number change:
23
...
- relates to
-
JDK-8108279 New/stop()ed Timelines always play() from time 0.
- Closed
-
JDK-8108612 Timeline.time cannot be set on Timeline w/ INDEFINITE repeatCount
- Closed