Package javafx.animation

Examples of javafx.animation.KeyFrame


  final FadeTransition fade = FadeTransitionBuilder.create()
    .node(this.itemGroup).duration(Duration.millis(400))
    .fromValue(0).toValue(1.0).build();
  anim.add(fade);

  final Animation offset = new Timeline(new KeyFrame(Duration.ZERO,
    new KeyValue(this.offsetProperty(), 0)), new KeyFrame(
    Duration.millis(300), new KeyValue(this.offsetProperty(),
      this.lastOffsetValue)));
  anim.add(offset);

  final Animation angle = new Timeline(new KeyFrame(Duration.ZERO,
    new KeyValue(this.initialAngleProperty(),
      this.lastInitialAngleValue + 20)), new KeyFrame(
    Duration.millis(300), new KeyValue(this.initialAngleProperty(),
      this.lastInitialAngleValue)));
  anim.add(angle);

  if (this.centerVisibility.get() == CenterVisibility.WITH_MENU) {
View Full Code Here


    }

    private void init() {
        // snap button back
        final KeyValue BUTTON_X_START = new KeyValue(endX, START_XCOORD);
        final KeyFrame LOCK_KEY_FRAME = new KeyFrame(Duration.millis(150), BUTTON_X_START);

        // make text more opaque
        final KeyValue TEXT_OPACITY_LOCK_KV = new KeyValue(textOpacity, 1);
        final KeyFrame TEXT_OPACITY_LOCK_KF = new KeyFrame(Duration.millis(150), TEXT_OPACITY_LOCK_KV);

        snapButtonBackAnim.getKeyFrames().addAll(LOCK_KEY_FRAME, TEXT_OPACITY_LOCK_KF);

        // move button to the right
        final KeyValue BUTTON_X_END     = new KeyValue(endX, END_XCOORD);
        final KeyFrame UNLOCK_KEY_FRAME = new KeyFrame(Duration.millis(1000), BUTTON_X_END);

        final KeyValue TEXT_OPACITY_UNLOCK_KV = new KeyValue(textOpacity, 0);
        final KeyFrame TEXT_OPACITY_UNLOCK_KF = new KeyFrame(Duration.millis(1000), TEXT_OPACITY_UNLOCK_KV);

        unlockAnimation.getKeyFrames().addAll(UNLOCK_KEY_FRAME, TEXT_OPACITY_UNLOCK_KF);
        unlockAnimation.setOnFinished(new EventHandler<ActionEvent>() {
            @Override public void handle(final ActionEvent EVENT) {
                setLocked(false);
View Full Code Here

            stage.setOpacity(0d);
            stage.show();
            final DoubleProperty opacity = stage.opacityProperty();

            Timeline fadeIn = new Timeline(
                    new KeyFrame(Duration.ZERO, new KeyValue(opacity, 0d)),
                    new KeyFrame(new Duration(fadeInOutTime * 1000),
                            new EventHandler() {
                                @Override
                                public void handle(Event t) {
                                    Timeline display = new Timeline(
                                            new KeyFrame(Duration.ZERO, new KeyValue(opacity, 1d)),
                                            new KeyFrame(new Duration((displayTime - fadeInOutTime * 2) * 1000),
                                                    new EventHandler() {
                                                        @Override
                                                        public void handle(Event t) {
                                                            Timeline fadeOut = new Timeline(
                                                                    new KeyFrame(Duration.ZERO, new KeyValue(opacity, 1d)),
                                                                    new KeyFrame(new Duration(fadeInOutTime * 1000),
                                                                            new EventHandler() {
                                                                                @Override
                                                                                public void handle(Event t) {
                                                                                    stage.hide();
                                                                                }
View Full Code Here

        // Mouse Handler for buttons
        //
        timeline = new Timeline();
        final EventHandler<ActionEvent> btnUpHandler = actionEvent -> CONTROL.increment();
        btnUp.setOnMousePressed(arg0 -> {
            final KeyFrame kf = new KeyFrame(Duration.millis(50), btnUpHandler);
            timeline.setDelay(Duration.millis(500));
            timeline.getKeyFrames().clear();
            timeline.getKeyFrames().add(kf);
            timeline.setCycleCount(Timeline.INDEFINITE);
            timeline.play();
            btnUpHandler.handle(null);
        });
        btnUp.setOnMouseReleased(mouseEvent -> timeline.stop());


        final EventHandler<ActionEvent> btnDownHandler = actionEvent -> {
            CONTROL.decrement();
        };
        btnDown.setOnMousePressed(arg0 -> {
            final KeyFrame kf = new KeyFrame(Duration.millis(50), btnDownHandler);
            timeline.setDelay(Duration.millis(500));
            timeline.getKeyFrames().clear();
            timeline.getKeyFrames().add(kf);
            timeline.setCycleCount(Timeline.INDEFINITE);
            timeline.play();
View Full Code Here

     * @param miniIconButton the mini icon button
     */
    private void configureBlinking(final MiniIconButton miniIconButton) {
        blinkTimeline.getKeyFrames().remove(kf);
        final KeyValue kv = new KeyValue(miniIconButton.getMiniIcon().opacityProperty(), MINIMUM_OPACITY_FOR_BLINKING);
        kf = new KeyFrame(Duration.millis(miniIconButton.getAnimationDuration()), kv);
        blinkTimeline.getKeyFrames().add(kf);
    }
View Full Code Here

            if (storeOldHeight) {
                oldHeight = control.getPrefHeight();
            }

            minimizeTimeLine = new Timeline(
                    new KeyFrame(Duration.ZERO,
                    new KeyValue(control.prefHeightProperty(), control.getPrefHeight())),
                    new KeyFrame(Duration.seconds(0.2),
                    new KeyValue(control.prefHeightProperty(), newHeight)));

            minimizeTimeLine.statusProperty().addListener(
                    new ChangeListener<Animation.Status>() {
                        @Override
View Full Code Here

        timeline.setCycleCount(1);

        KeyValue keyValue = new KeyValue(tabRegion.prefWidth, endValue, Interpolator.LINEAR);

        timeline.getKeyFrames().clear();
        timeline.getKeyFrames().add(new KeyFrame(duration, func, keyValue));
        return timeline;
    }
View Full Code Here

        private void createScrollTimeline(final double val) {
            scroll(val);
            scroller = new Timeline();
            scroller.setCycleCount(Timeline.INDEFINITE);
            scroller.getKeyFrames().add(new KeyFrame(Duration.millis(150), new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent event) {
                    scroll(val);
                }
            }));
        }
View Full Code Here

            Timeline timeline = new Timeline();
            KeyValue keyValue = new KeyValue(controlTabHeight, prefHeight, Interpolator.EASE_OUT);

            setVisible(true);
            timeline.getKeyFrames().clear();
            timeline.getKeyFrames().add(new KeyFrame(Duration.millis(ANIMATION_SPEED), new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent event) {
                    if (popup == null) {
                        setupPopupMenu();
                    }
                    requestLayout();
View Full Code Here

            setAnimationLock(true);
            Timeline timeline = new Timeline();
            KeyValue keyValue = new KeyValue(controlTabHeight, 0.0, Interpolator.EASE_IN);

            timeline.getKeyFrames().clear();
            timeline.getKeyFrames().add(new KeyFrame(Duration.millis(ANIMATION_SPEED), new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent event) {
                    if (!isShowTabsMenu()) {
                        downArrowBtn.setVisible(false);
                    }
                    // If the scroll arrows or tab menu is still visible we don't want
View Full Code Here

TOP

Related Classes of javafx.animation.KeyFrame

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.