Package javafx.animation

Examples of javafx.animation.KeyFrame


          item.setTranslateX(newX);
          item.scaleXProperty().set(newScale);
          item.scaleYProperty().set(newScale);
          item.angle.set(newAngle);
        } else {
            keyFrames.add(new KeyFrame(duration,
                    new KeyValue(item.translateXProperty(), newX, INTERPOLATOR),
                    new KeyValue(item.scaleXProperty(), newScale, INTERPOLATOR),
                    new KeyValue(item.scaleYProperty(), newScale, INTERPOLATOR),
                    new KeyValue(item.angle, newAngle, INTERPOLATOR)));
        }
View Full Code Here


  private Cursor() {
    super(0, 0, 1.6, 18);
    this.setFill(Color.BLACK);
    caretTimeline.setCycleCount(Timeline.INDEFINITE);
    caretTimeline.getKeyFrames().addAll(
        new KeyFrame(Duration.ZERO, event -> {
          this.setFill(Color.TRANSPARENT);
        }), new KeyFrame(Duration.seconds(.5), event -> {
          Cursor.this.setFill(Color.BLACK);
        }), new KeyFrame(Duration.seconds(1)));
    caretTimeline.play();
    this.setCursor(javafx.scene.Cursor.TEXT);
    // this.setOnMouseClicked(event -> {
    // System.out.println(this.getLayoutBounds());
    // });
View Full Code Here

    @Override
    public void restart() {
        stop();
        long expected = seq;
        timeline.getKeyFrames().setAll(new KeyFrame(timeout, ae -> {
            if(seq == expected) {
                action.run();
            }
        }));
        timeline.play();
View Full Code Here

    }

    void animate(double toValue){
        Timeline timeline = new Timeline();
        timeline.getKeyFrames().add(
                new KeyFrame(Duration.seconds(1),
                        new KeyValue(getMaxHeightProperty(), toValue)));
        timeline.playFromStart();
    }
View Full Code Here

    KeyValue keyValueStartY = new KeyValue(node.translateYProperty(), annimation.starty);
    KeyValue keyValueEndX = new KeyValue(node.translateXProperty(),annimation.endx);
    KeyValue keyValueEndY = new KeyValue(node.translateYProperty(), annimation.endy);
   

    KeyFrame keyFrame1 = new KeyFrame(Duration.millis(startTimeMs),
          new EventHandler<ActionEvent>(){
            @Override
            public void handle(ActionEvent event) {
              animationPane.getChildren().add(node);
            }
              },new KeyValue(node.opacityProperty(), 0));
    KeyFrame keyFrame2 = new KeyFrame(Duration.millis(startTimeMs), keyValueStartX, keyValueStartY);
    KeyFrame keyFrame3 = new KeyFrame(Duration.millis(startTimeMs+FADEDURATION),new KeyValue(node.opacityProperty(), 1));
    KeyFrame keyFrame4 = new KeyFrame(Duration.millis(startTimeMs+FADEDURATION), keyValueStartX, keyValueStartY);
    KeyFrame keyFrame5 = new KeyFrame(Duration.millis(endTimeMs-FADEDURATION),keyValueEndX,keyValueEndY);
    KeyFrame keyFrame6 = new KeyFrame(Duration.millis(endTimeMs-FADEDURATION), new KeyValue(node.opacityProperty(), 1));
    KeyFrame keyFrame7 = new KeyFrame(Duration.millis(endTimeMs),
        new EventHandler<ActionEvent>(){
          @Override
          public void handle(ActionEvent event) {
            animationPane.getChildren().remove(node);
          }
View Full Code Here

      ((InnerShadow) effect).setColor(offColor);
    }
    final Timeline timeline = new Timeline();
    timeline.setCycleCount(cycleCount <=0 ? Timeline.INDEFINITE : cycleCount);
    timeline.setAutoReverse(true);
    final KeyFrame kf = new KeyFrame(Duration.millis(500), new EventHandler<ActionEvent>() {
      @Override
      public void handle(final ActionEvent event) {
        if (effect instanceof DropShadow) {
          ((DropShadow) effect).setColor(
              ((DropShadow) effect).getColor().equals(offColor) ? onColor : offColor);
View Full Code Here

    public RotateInTransition(final Node node) {
        super(
            node,
            TimelineBuilder.create()
                .keyFrames(
                    new KeyFrame(Duration.millis(0),   
                        new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                        new KeyValue(node.rotateProperty(), -200, WEB_EASE)
                    ),
                    new KeyFrame(Duration.millis(1000),   
                        new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                        new KeyValue(node.rotateProperty(), 0, WEB_EASE)
                    )
                )
                .build());
View Full Code Here

    @Override protected void starting() {
        double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY();
        timeline = TimelineBuilder.create()
                .keyFrames(
                    new KeyFrame(Duration.millis(0),   
                        new KeyValue(node.translateYProperty(), 0, WEB_EASE)
                    ),
                    new KeyFrame(Duration.millis(200),   
                        new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                        new KeyValue(node.translateYProperty(), -20, WEB_EASE)
                    ),
                    new KeyFrame(Duration.millis(1000),   
                        new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                        new KeyValue(node.translateYProperty(), endY, WEB_EASE)
                    )
                )
                .build();
View Full Code Here

    @Override protected void starting() {
        super.starting();
        timeline = TimelineBuilder.create()
            .keyFrames(
                new KeyFrame(Duration.millis(0),   
                    new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                    new KeyValue(node.translateXProperty(), 0, WEB_EASE),
                    new KeyValue(node.rotateProperty(), 0, WEB_EASE)
                ),
                new KeyFrame(Duration.millis(1000),   
                    new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                    new KeyValue(node.translateXProperty(), node.getBoundsInLocal().getWidth(), WEB_EASE),
                    new KeyValue(node.rotateProperty(), 120, WEB_EASE)
                )
            )
View Full Code Here

    public FadeInLeftTransition(final Node node) {
        super(
            node,
            TimelineBuilder.create()
                .keyFrames(
                    new KeyFrame(Duration.millis(0),   
                        new KeyValue(node.opacityProperty(), 0, WEB_EASE),
                        new KeyValue(node.translateXProperty(), -20, WEB_EASE)
                    ),
                    new KeyFrame(Duration.millis(1000),   
                        new KeyValue(node.opacityProperty(), 1, WEB_EASE),
                        new KeyValue(node.translateXProperty(), 0, WEB_EASE)
                    )
                )
                .build()
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.