Java 类javafx.animation.SequentialTransitionBuilder 实例源码

项目:MasteringTables    文件:ResultView.java   
/**
 * {@inheritDoc}
 */
@Override
public void start() {
    SequentialTransitionBuilder.create()
                               .children(

                                         buildBeanAnimation(this.ratioLabel, this.ratioCircle, MTColors.RESULT_RATIO.get()),
                                         buildBeanAnimation(this.timeLabel, this.timeBean, MTColors.RESULT_TIME.get()),

                                         ParallelTransitionBuilder.create()
                                                                  .children(
                                                                            TranslateTransitionBuilder.create().node(this.monsterImage).delay(Duration.millis(500)).duration(Duration.millis(400))
                                                                                                      .byY(-766).build(),
                                                                            buildBeanAnimation(this.successLabel, this.successBean, MTColors.RESULT_SUCCESS.get()),
                                                                            FadeTransitionBuilder.create().node(this.successIcon).duration(Duration.millis(500)).fromValue(0).toValue(1).build())
                                                                  .build(),

                                         ParallelTransitionBuilder.create()
                                                                  .children(
                                                                            buildBeanAnimation(this.failureLabel, this.failureBean, MTColors.RESULT_FAILURE.get()),
                                                                            FadeTransitionBuilder.create().node(this.failureIcon).duration(Duration.millis(500)).fromValue(0).toValue(1).build())
                                                                  .build()

                               )

                               .build().playFromStart();

}
项目:javafx-demos    文件:JavaFX_BoardAnimation.java   
public void start(Stage primaryStage) {
      primaryStage.setTitle("The Board In Action");

      final ImageView imageView = new ImageView(IMAGE);
      imageView.setViewport(new Rectangle2D(0, 0, WIDTH, HEIGHT));

      final Animation animation = new SpriteAnimation(
              imageView,
              Duration.millis(600),
              COUNT, COLUMNS,
              WIDTH, HEIGHT
      );
      animation.setCycleCount(3);
     // animation.play();

      final Animation animation2 = new SpriteAnimation(
              imageView,
              Duration.millis(1200),
              COUNT, COLUMNS,
              WIDTH, HEIGHT
      );
      animation2.setCycleCount(3);
      //animation2.play();

      final Animation animation3 = new SpriteAnimation(
              imageView,
              Duration.millis(1800),
              COUNT, COLUMNS,
              WIDTH, HEIGHT
      );
      animation3.setCycleCount(3);

      final Animation animation4 = new SpriteAnimation(
              imageView,
              Duration.millis(2400),
              COUNT, COLUMNS,
              WIDTH, HEIGHT
      );
      animation4.setCycleCount(3);

      final SequentialTransition sequentialTransition = SequentialTransitionBuilder.create()
.children(animation, animation2, animation3, animation4)
.cycleCount(1)
.autoReverse(true)
.build();
      sequentialTransition.play();

      primaryStage.setScene(new Scene(new Group(imageView)));
      primaryStage.show();
  }
项目:Zcreen    文件:EggTransitionHandler.java   
private SequentialTransition createSwapImagesTransition(Image image) {
    return SequentialTransitionBuilder.create().children(createFadeOutTransition(image), createFadeInTransition()).build();
}
项目:MasteringTables    文件:ExpressionView.java   
/**
 * {@inheritDoc}
 */
@Override
protected void initView() {

    node().setAlignment(Pos.CENTER);

    node().setPrefSize(650, 200);
    node().setMaxSize(700, 200);

    this.leftOperand = getExpressionTextBuilder()
                                                 .wrappingWidth(180)
                                                 .build();

    this.operator = getExpressionTextBuilder()
                                              .wrappingWidth(60)
                                              .build();

    this.rightOperand = getExpressionTextBuilder()
                                                  .wrappingWidth(120)
                                                  .build();

    this.equality = getExpressionTextBuilder()
                                              .wrappingWidth(60)
                                              .text("=")
                                              .build();

    this.result = getExpressionTextBuilder()
                                            .wrappingWidth(180)
                                            .scaleX(1.0)
                                            .scaleY(1.0)
                                            .text("")
                                            .build();

    node().getChildren().addAll(this.leftOperand, this.operator, this.rightOperand, this.equality, this.result);

    // Manage Animation
    this.expressionResolved = buildExpressionResolved();
    this.expressionFailure = buildExpressionFailure();

    this.showExpression = SequentialTransitionBuilder.create()
                                                     .children(
                                                               buildTextPartAnimation(getLeftOperand()),
                                                               buildTextPartAnimation(getOperator()),
                                                               buildTextPartAnimation(getRightOperand()),
                                                               buildTextPartAnimation(getEquality()))
                                                     .build();

    // Add a nice drop shadow in all direction
    final DropShadow s = DropShadowBuilder.create()
                                          .height(10)
                                          .width(10)
                                          .color(Color.BLACK)
                                          .blurType(BlurType.THREE_PASS_BOX)
                                          .radius(10)
                                          .spread(0.1)
                                          .build();

    node().setEffect(s);
}
项目:JRebirth-Tour    文件:AbstractBaseView.java   
/**
 * TODO To complete.
 *
 * @param nextSlide the next slide
 */
private void performStepAnimation(final Node nextSlide) {

    this.subSlideTransition = ParallelTransitionBuilder.create()

                                                       .onFinished(new EventHandler<ActionEvent>() {

                                                           @Override
                                                           public void handle(final ActionEvent event) {
                                                               AbstractBaseView.this.currentSubSlide = nextSlide;
                                                           }
                                                       })

                                                       .children(
                                                                 SequentialTransitionBuilder.create()
                                                                                            .node(this.currentSubSlide)
                                                                                            .children(
                                                                                                      TranslateTransitionBuilder.create()
                                                                                                                                .duration(Duration.millis(400))
                                                                                                                                .fromY(0)
                                                                                                                                .toY(-700)
                                                                                                                                // .fromZ(-10)
                                                                                                                                .build(),
                                                                                                      TimelineBuilder.create()
                                                                                                                     .keyFrames(
                                                                                                                                new KeyFrame(Duration.millis(0),
                                                                                                                                             new KeyValue(this.currentSubSlide.visibleProperty(),
                                                                                                                                                          true)),
                                                                                                                                new KeyFrame(Duration.millis(1),
                                                                                                                                             new KeyValue(this.currentSubSlide.visibleProperty(),
                                                                                                                                                          false)))
                                                                                                                     .build())

                                                                                            .build(),
                                                                 SequentialTransitionBuilder.create()
                                                                                            .node(nextSlide)
                                                                                            .children(
                                                                                                      TimelineBuilder.create()
                                                                                                                     .keyFrames(
                                                                                                                                new KeyFrame(Duration.millis(0),
                                                                                                                                             new KeyValue(nextSlide.visibleProperty(), false)),
                                                                                                                                new KeyFrame(Duration.millis(1),
                                                                                                                                             new KeyValue(nextSlide.visibleProperty(), true)))
                                                                                                                     .build(),
                                                                                                      TranslateTransitionBuilder.create()
                                                                                                                                .duration(Duration.millis(400))
                                                                                                                                .fromY(700)
                                                                                                                                .toY(0)
                                                                                                                                // .fromZ(-10)
                                                                                                                                .build())
                                                                                            .build())
                                                       .build();
    this.subSlideTransition.play();

}
项目:JRebirth-Tour    文件:BasicView.java   
/**
 * TODO To complete.
 *
 * @param nextSlide the next slide
 */
private void performStepAnimation(final Node nextSlide) {

    this.subSlideTransition = ParallelTransitionBuilder.create()

                                                       .onFinished(new EventHandler<ActionEvent>() {

                                                           @Override
                                                           public void handle(final ActionEvent event) {
                                                               BasicView.this.currentSubSlide = nextSlide;
                                                           }
                                                       })

                                                       .children(
                                                                 SequentialTransitionBuilder.create()
                                                                                            .node(this.currentSubSlide)
                                                                                            .children(
                                                                                                      TranslateTransitionBuilder.create()
                                                                                                                                .duration(Duration.millis(400))
                                                                                                                                .fromY(model().isForwardFlow() ? 0 : 0)
                                                                                                                                .toY(model().isForwardFlow() ? -700 : 700)
                                                                                                                                // .fromZ(-10)
                                                                                                                                .build(),
                                                                                                      TimelineBuilder.create()
                                                                                                                     .keyFrames(
                                                                                                                                new KeyFrame(Duration.millis(0),
                                                                                                                                             new KeyValue(this.currentSubSlide.visibleProperty(),
                                                                                                                                                          true)),
                                                                                                                                new KeyFrame(Duration.millis(1),
                                                                                                                                             new KeyValue(this.currentSubSlide.visibleProperty(),
                                                                                                                                                          false)))
                                                                                                                     .build())

                                                                                            .build(),
                                                                 SequentialTransitionBuilder.create()
                                                                                            .node(nextSlide)
                                                                                            .children(
                                                                                                      TimelineBuilder.create()
                                                                                                                     .keyFrames(
                                                                                                                                new KeyFrame(Duration.millis(0),
                                                                                                                                             new KeyValue(nextSlide.visibleProperty(), false)),
                                                                                                                                new KeyFrame(Duration.millis(1),
                                                                                                                                             new KeyValue(nextSlide.visibleProperty(), true)))
                                                                                                                     .build(),
                                                                                                      TranslateTransitionBuilder.create()
                                                                                                                                .duration(Duration.millis(400))
                                                                                                                                .fromY(model().isForwardFlow() ? 700 : -700)
                                                                                                                                .toY(model().isForwardFlow() ? 0 : 0)
                                                                                                                                // .fromZ(-10)
                                                                                                                                .build())
                                                                                            .build())
                                                       .build();
    this.subSlideTransition.play();

}