/** * 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(); }
@Override protected Animation createAndPrepareAnimation(Node curNode, Node newNode) { newNode.setOpacity(1); double deltaX = -curNode.getBoundsInLocal().getWidth(); newNode.setTranslateX(-deltaX); TranslateTransitionBuilder builder = TranslateTransitionBuilder.create() .interpolator(Interpolator.EASE_BOTH) .byX(deltaX) .duration(new Duration(1000)); return ParallelTransitionBuilder.create() .children(builder.node(curNode).build(), builder.node(newNode).build()) .build(); }
/** {@inheritDoc} */ @Override public void reload() { // MUST be refactored with property binding // this.pageLabel.setText(String.valueOf(model().getSlideNumber())); // FadeTransitionBuilder.create() // .node(node().getTop()) // .duration(Duration.millis(600)) // .fromValue(0).toValue(0.7) // .build().play(); // FadeTransitionBuilder.create() // .node(node().getCenter()) // .duration(Duration.millis(600)) // .fromValue(0) // .toValue(0.4) // .build().play(); final MotionBlur mb = MotionBlurBuilder.create().angle(180).build(); this.primaryTitle.setEffect(mb); ParallelTransitionBuilder.create() .children( // ParallelTransitionBuilder.create().children( ScaleTransitionBuilder.create() .node(this.smallPokemon) .duration(Duration.millis(400)) .fromX(0) .fromY(0) .toX(1) .toY(1) .build(), RotateTransitionBuilder.create() .node(this.smallPokemon) .duration(Duration.millis(800)) .fromAngle(1080) .toAngle(-135) .build(), ScaleTransitionBuilder.create() .node(this.bigPokemon) .delay(Duration.millis(200)) .duration(Duration.millis(400)) .fromX(0) .fromY(0) .toX(1.2) .toY(1.2) .build(), RotateTransitionBuilder.create() .node(this.bigPokemon) .delay(Duration.millis(200)) .duration(Duration.millis(800)) .fromAngle(0) .toAngle(1080) .build(), TimelineBuilder.create() .delay(Duration.millis(200)) .keyFrames( new KeyFrame( Duration.millis(0), new KeyValue(this.topRectangle.widthProperty(), 0)), new KeyFrame( Duration.millis(600), new KeyValue(this.topRectangle.widthProperty(), 300))) .build(), TimelineBuilder.create() .delay(Duration.millis(1200)) .keyFrames( new KeyFrame( Duration.millis(0), new KeyValue(this.bottomRectangle.widthProperty(), 0), new KeyValue(this.bottomRectangle.xProperty(), 1000)), new KeyFrame( Duration.millis(300), new KeyValue(this.bottomRectangle.widthProperty(), 300), new KeyValue(this.bottomRectangle.xProperty(), 700))) .build(), TranslateTransitionBuilder.create() .node(this.placeLogo) .delay(Duration.millis(1200)) .duration(Duration.millis(300)) .toX(-400) .build(), TranslateTransitionBuilder.create() .node(this.primaryTitle) .delay(Duration.millis(200)) .duration(Duration.millis(400)) .toX(-3000 + 130) .build(), TimelineBuilder.create() .keyFrames( new KeyFrame(Duration.millis(0), new KeyValue(mb.radiusProperty(), 0)), new KeyFrame(Duration.millis(100), new KeyValue(mb.radiusProperty(), 50)), new KeyFrame(Duration.millis(200), new KeyValue(mb.radiusProperty(), 63)), new KeyFrame(Duration.millis(300), new KeyValue(mb.radiusProperty(), 50)), new KeyFrame(Duration.millis(400), new KeyValue(mb.radiusProperty(), 0))) .build(), // ).build() ParallelTransitionBuilder.create() .delay(Duration.millis(600)) .children( // RotateTransitionBuilder // .create() // .duration(Duration.millis(600)) // .fromAngle(-180) // .toAngle(0) // .build(), TranslateTransitionBuilder.create() .duration(Duration.millis(600)) .fromX(1024 / 2) .fromY(768 / 2) .toX(0) .toY(0) .build(), ScaleTransitionBuilder.create() .duration(Duration.millis(600)) .fromX(0) .fromY(0) .toX(1) .toY(1) .build()) .node(this.slideContent) .build()) .build() .play(); }
public Animations( Node toAnimate, boolean initiallyVisible, Duration slideDown, Duration slideUp, Duration fadeIn, Duration fadeAway) { this.toAnimate = toAnimate; toAnimate.setVisible(initiallyVisible); state = initiallyVisible ? State.VISIBLE : State.HIDDEN; SLIDE_DOWN = TranslateTransitionBuilder.create() .fromY(-200) .toY(0) .node(toAnimate) .duration(slideDown) .onFinished( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent arg0) { toVisibleState(); } }) .build(); SLIDE_UP = TranslateTransitionBuilder.create() .fromY(0) .toY(-200) .node(toAnimate) .duration(slideUp) .onFinished( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent arg0) { toHiddenState(); } }) .build(); FADE_AWAY = FadeTransitionBuilder.create() .node(toAnimate) .fromValue(1) .toValue(0) .duration(fadeAway) .onFinished( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent arg0) { toHiddenState(); } }) .build(); FADE_IN = FadeTransitionBuilder.create() .node(toAnimate) .fromValue(0) .toValue(1) .duration(fadeIn) .onFinished( new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent arg0) { toVisibleState(); } }) .build(); }