Package javafx.animation

Examples of javafx.animation.ParallelTransition


                }

                // final String animationKey = isReverse ? this.slidePosition + "_" + (this.slidePosition + 1) : this.slidePosition - 1 + "_" + this.slidePosition;

                // Play the animation<
                final ParallelTransition slideAnimation = buildSlideTransition(isReverse, previousSlideModel, this.selectedSlideModel);

                if (isReverse) {

                    slideAnimation.setRate(-1);
                    slideAnimation.playFrom(slideAnimation.getCycleDuration());
                } else {
                    slideAnimation.setRate(1);
                    slideAnimation.playFromStart();
                }

                // Store the new default slide
                this.selectedSlide = slide;
View Full Code Here


     * @param selectedSlideModel the current slide model
     *
     * @return the animation to show
     */
    private ParallelTransition buildSlideTransition(final boolean isReverse, final SlideModel<SlideStep> previousSlideModel, final SlideModel<SlideStep> selectedSlideModel) {
        final ParallelTransition slideAnimation = ParallelTransitionBuilder.create().build();

        if (previousSlideModel != null) {
            final Animation a = isReverse ? previousSlideModel.getShowAnimation() : previousSlideModel.getHideAnimation();
            if (a != null) {
                slideAnimation.getChildren().add(a);
            }
        }
        if (this.selectedSlideModel != null) {
            final Animation a = isReverse ? this.selectedSlideModel.getHideAnimation() : this.selectedSlideModel.getShowAnimation();
            if (a != null) {
                slideAnimation.getChildren().add(a);
            }
        }

        final SlideModel<SlideStep> csm = selectedSlideModel;
        final SlideModel<SlideStep> psm = previousSlideModel;
        slideAnimation.setOnFinished(new javafx.event.EventHandler<ActionEvent>() {

            @Override
            public void handle(final ActionEvent arg0) {
                // // Hide previous slide
                // if (psm != null) {
View Full Code Here

        // The new node is the one create by PrepareModelCommand
        final Node newNode = getWaveBean(wave).getShowModel() == null ? null : getWaveBean(wave).getShowModel().getRootNode();

        if (oldNode != null || newNode != null) {
            final ParallelTransition animation = ParallelTransitionBuilder.create()
                    .build();

            if (oldNode != null) {
                animation.getChildren().add(
                        FadeTransitionBuilder.create()
                                .duration(Duration.millis(600))
                                .node(oldNode)
                                .fromValue(1.0)
                                .toValue(0.0)
                                .build());
            }
            if (newNode != null) {
                animation.getChildren().add(
                        FadeTransitionBuilder.create()
                                .duration(Duration.millis(600))
                                .node(newNode)
                                .fromValue(0.0)
                                .toValue(1.0)
                                .build());
            }

            final Node oldNodeLink = oldNode;

            // When animation is finished remove the hidden node from the stack to let only one node at the same time
            animation.setOnFinished(new EventHandler<ActionEvent>() {

                /**
                 * {@inheritDoc}
                 */
                @Override
                public void handle(final ActionEvent arg0) {
                    if (oldNodeLink != null) {
                        // remove the old nod from the stack to hide it
                        getWaveBean(wave).getChidrenPlaceHolder().remove(oldNodeLink);

                        LOGGER.info("Remove " + oldNodeLink.toString() + " from stack container");
                    }
                    // FIXME do it in the right way
                    getWaveBean(wave).getShowModel().doShowView(wave);
                }
            });
            animation.playFromStart();
        }
    }
View Full Code Here

     * @param nextSlide the next subSlide to show
     */
    private void performStepAnimation(final Node nextSlide) {

        setSlideLocked(true);
        final ParallelTransition subSlideTransition = ParallelTransitionBuilder.create()

                .onFinished(new EventHandler<ActionEvent>() {

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

                .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();
        subSlideTransition.play();

    }
View Full Code Here

        // for (int i = 0; i < 20; i++) {
        // p.getChildren().add(RectangleBuilder.create().x(i * 40).y(0).width(40).height(600).fill(Color.AZURE).build());
        // }

        final ParallelTransition parallel = ParallelTransitionBuilder.create()
                .build();

        // // int i = 0;
        // // Collections.shuffle(nodes);
        // for (final Node node : this.nodes) {
        // node.setCache(true);
        // node.setCacheHint(CacheHint.SPEED);
        //
        // ((ParallelTransition) this.fullTransition).getChildren().add(
        // TranslateTransitionBuilder.create().delay(getRandomDuration()).node(node).toY(1000).duration(Duration.millis(500)).interpolator(Interpolator.EASE_IN).build());
        // // i++;
        // }

        int i = 0;
        for (final Node node : this.nodes) {

            parallel.getChildren().add(
                    TranslateTransitionBuilder.create()
                            .delay(Duration.millis(i * getNodeDelay()))
                            .node(node)
                            // .fromY(0)
                            // .toY(1000)
View Full Code Here

                ((TranslateTransition) event.getSource()).getNode().setEffect(null);
            }

        };

        final ParallelTransition st = ParallelTransitionBuilder.create().delay(Duration.seconds(1)).autoReverse(true).cycleCount(10).build();
        int i = 0;
        for (final Node n : p.getChildren()) {

            st.getChildren().add(
                    TranslateTransitionBuilder.create()
                            .delay(Duration.millis(i * 50))
                            .node(n)
                            .fromY(0)
                            .toY(1000)
                            .duration(Duration.millis(1000))
                            .interpolator(Interpolator.EASE_IN)
                            .onFinished(shadowRemover)
                            .build()
                    );
            i++;
        }

        st.play();
    }
View Full Code Here

        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
        fadeValueIn.setFromValue(0.0);
        fadeValueIn.setToValue(1.0);
        ParallelTransition parallelIn = new ParallelTransition(fadeUnitIn, fadeValueIn);

        ParallelTransition parallelOut = new ParallelTransition(fadeUnitOut, fadeValueOut);
        parallelOut.setOnFinished(event -> {
            unit.setText("Interactive");
            value.setText("");
            resizeText();
        });
View Full Code Here

            mainButtonFadeOut.setToValue(options.getButtonAlpha());
            transitions.add(mainButtonFadeOut);
        }

        // Play all transitions in parallel
        ParallelTransition selectTransition = new ParallelTransition();
        selectTransition.getChildren().addAll(transitions);
        selectTransition.play();

        // Set menu state back to closed
        setState(State.CLOSED);
        mainMenuButton.setOpen(false);
    }
View Full Code Here

        fadeUnitIn.setFromValue(0.0);
        fadeUnitIn.setToValue(1.0);
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
        fadeValueIn.setFromValue(0.0);
        fadeValueIn.setToValue(1.0);
        ParallelTransition parallelIn = new ParallelTransition(fadeUnitIn, fadeValueIn);

        ParallelTransition parallelOut = new ParallelTransition(fadeUnitOut, fadeValueOut);
        parallelOut.setOnFinished(event -> {
            unit.setText("Interactive");
            value.setText("");
            resizeText();
        });
View Full Code Here

       
        FadeTransition fadeValueIn = new FadeTransition(Duration.millis(425), value);
        fadeValueIn.setFromValue(0.0);
        fadeValueIn.setToValue(1.0);               
       
        ParallelTransition parallelIn = new ParallelTransition(fadeInfoTextIn, fadeValueIn);

        ParallelTransition parallelOut = new ParallelTransition(fadeInfoTextOut, fadeValueOut);
        parallelOut.setOnFinished(event -> {
            double currentValue = (valueIndicatorRotate.getAngle() + getSkinnable().getStartAngle() - 180) / angleStep + getSkinnable().getMinValue();
            value.setText(String.format(Locale.US, "%." + getSkinnable().getDecimals() + "f", currentValue));
            value.setTranslateX((size - value.getLayoutBounds().getWidth()) * 0.5);
            if (getSkinnable().getTarget() < getSkinnable().getValue()) {
                getSkinnable().setInfoText("COOLING");
View Full Code Here

TOP

Related Classes of javafx.animation.ParallelTransition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.