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

[Animation] Combinations of transitions don't work as expected (circle should fade in)

    XMLWordPrintable

    Details

      Description

      To reproduce run following code

      Circle will appear immediately.
      Expected: circle fade in every cycle.

      import javafx.animation.FadeTransition;
      import javafx.animation.ParallelTransition;
      import javafx.animation.SequentialTransition;
      import javafx.application.Application;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.shape.Circle;
      import javafx.stage.Stage;
      import javafx.util.Duration;

      public class FadeSample extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(Stage primaryStage) {
              Group group = new Group();
              primaryStage.setScene(new Scene(group));
              Circle e = new Circle(50);
              e.setOpacity(0);
              group.getChildren().add(e);
              group.setTranslateX(50);
              group.setTranslateY(50);
              primaryStage.show();
              ParallelTransition pt = new ParallelTransition();
              FadeTransition transition = new FadeTransition(Duration.seconds(3),e);
              transition.setToValue(1.0);
              transition.setDelay(Duration.seconds(3));
              System.out.println(transition.getTotalDuration());
              pt.getChildren().add(new SequentialTransition(transition));
              pt.playFromStart();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              msladecek Martin Sládeček
              Reporter:
              anazarov Andrey Nazarov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: