Java 类javafx.animation.ParallelTransitionBuilder 实例源码

项目:MasteringTables    文件:ExpressionView.java   
/**
 * Builds the text part animation.
 *
 * @param textNode the text node
 * @return the animation
 */
private Animation buildTextPartAnimation(final Text textNode) {
    return ParallelTransitionBuilder.create()
                                    .node(textNode)
                                    .children(

                                              ScaleTransitionBuilder.create()
                                                                    .duration(Duration.millis(300)) // SHOULD BE CONFIGURABLE (Game Speed)
                                                                    .fromX(0.0).toX(1.0)
                                                                    .fromY(0.0).toY(1.0)
                                                                    .build())

                                    .build();
}
项目:MasteringTables    文件:ExpressionView.java   
/**
 * Gets the expression resolved.
 *
 * @return the expression resolved
 */
private Animation buildExpressionResolved() {

    return ParallelTransitionBuilder.create()
                                    .delay(Duration.millis(400))
                                    .children(
                                              ScaleTransitionBuilder.create()
                                                                    .node(this.result)
                                                                    .fromX(1).toX(4.0)
                                                                    .fromY(1).toY(4.0)
                                                                    .build(),

                                              ScaleTransitionBuilder.create()
                                                                    .node(getLeftOperand())
                                                                    .fromX(1).toX(0)
                                                                    .fromY(1).toY(0)
                                                                    .build(),
                                              ScaleTransitionBuilder.create()
                                                                    .node(getOperator())
                                                                    .fromX(1).toX(0)
                                                                    .fromY(1).toY(0)
                                                                    .build(),
                                              ScaleTransitionBuilder.create()
                                                                    .node(getRightOperand())
                                                                    .fromX(1).toX(0)
                                                                    .fromY(1).toY(0)
                                                                    .build(),
                                              ScaleTransitionBuilder.create()
                                                                    .node(getEquality())
                                                                    .fromX(1).toX(0)
                                                                    .fromY(1).toY(0)
                                                                    .build())
                                    .build();
}
项目: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();

}
项目:MasteringTables    文件:ResultView.java   
/**
 * Build a bean animation.
 *
 * @param label the attached label
 * @param shape the shape to show
 * @param fillColor the color to use to paint the shape
 *
 * @return the bean animation
 */
private Animation buildBeanAnimation(final Label label, final Shape shape, final Color fillColor) {
    return ParallelTransitionBuilder.create()
                                    .children(
                                              ScaleTransitionBuilder.create().node(label).delay(Duration.millis(50)).duration(Duration.millis(300))
                                                                    .fromX(0).fromY(0).toX(1).toY(1).build(),
                                              FillTransitionBuilder.create().shape(shape)
                                                                   .fromValue(Color.LIGHTGREY).toValue(fillColor)
                                                                   .build())
                                    .build();
}
项目: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();

}
项目:JRebirth-Tour    文件:PatternView.java   
/**
 * TODO To complete.
 * 
 * @param gf
 * @return
 */
protected Animation getParallel(final Animation... animation) {
    return ParallelTransitionBuilder.create().children(animation).build();
}