-
Bug
-
Resolution: Fixed
-
P4
-
fx2.1.1
-
I'm using JavaFX 2.1.1 with JDK1.7.0_05. IDE is Eclipse 3.7.2 on a Windows vista machine.
JavaFX is using software rendering, because the business hardware the project is supposed to run on is too old.
Hi everybody,
I tried to make an application look better by adding a fade effect to a 'set visibility' checkbox. Here's what I did:
<snip>
final CheckBox check = new CheckBox("Show details");
final ParallelTransition fade = new ParallelTransition();
for (Group someDetail : theDetails)) {
FadeTransition fadeOne = new FadeTransition(new Duration(2000),
someDetail);
fadeOne.setFromValue(1);
fadeOne.setToValue(0);
fade.getChildren().add(fadeOne);
}
check.setSelected(true);
check.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
fade.setRate((check.isSelected() ? -1 : 1));
fade.play();
}
});
<snip>
When clicking the Checkbox after any previous animation is finished, everything is fine.
When clicking it again while the previous fade is still in Progress, it doesn't work as specified (I think):
What happens is that the animation restarts from the beginning using the same rate as before.
(Finishing with the check box and the visibility out of sync).
What shoud happen according to my understanding of the javadoc pages of play() and setRate() is that the sign reversal in setRate() causes the animation to run back to its starting point, while play() simply gets ignored (beause the animation is already running).
I tried to make an application look better by adding a fade effect to a 'set visibility' checkbox. Here's what I did:
<snip>
final CheckBox check = new CheckBox("Show details");
final ParallelTransition fade = new ParallelTransition();
for (Group someDetail : theDetails)) {
FadeTransition fadeOne = new FadeTransition(new Duration(2000),
someDetail);
fadeOne.setFromValue(1);
fadeOne.setToValue(0);
fade.getChildren().add(fadeOne);
}
check.setSelected(true);
check.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
fade.setRate((check.isSelected() ? -1 : 1));
fade.play();
}
});
<snip>
When clicking the Checkbox after any previous animation is finished, everything is fine.
When clicking it again while the previous fade is still in Progress, it doesn't work as specified (I think):
What happens is that the animation restarts from the beginning using the same rate as before.
(Finishing with the check box and the visibility out of sync).
What shoud happen according to my understanding of the javadoc pages of play() and setRate() is that the sign reversal in setRate() causes the animation to run back to its starting point, while play() simply gets ignored (beause the animation is already running).