Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8126131

ParallelTransition/SequentialTransition: Change of rate during the animation play not working

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.1.1
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      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.

      Description

      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).

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: