javafx.animation.Timeline.setAutoReverse()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中javafx.animation.Timeline.setAutoReverse()方法的一些代码示例,展示了Timeline.setAutoReverse()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timeline.setAutoReverse()方法的具体详情如下:
包路径:javafx.animation.Timeline
类名称:Timeline
方法名:setAutoReverse

Timeline.setAutoReverse介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

timeline.setAutoReverse(true);
timeline.setCycleCount(Timeline.INDEFINITE);

代码示例来源:origin: stackoverflow.com

KeyValue start = new KeyValue(enemy.translateXProperty(), 0);
KeyValue end = new KeyValue(enemy.translateXProperty(), 600);

KeyFrame startFrame = new KeyFrame(Duration.ZERO, start);
KeyFrame endFrame = new KeyFrame(Duration.seconds(5), end);

Timeline timeline = new Timeline(startFrame, endFrame);
timeline.setAutoReverse(true);
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.play();

代码示例来源:origin: stackoverflow.com

final void hide(EventHandler<ActionEvent> nextAction){
  final Timeline timeline = new Timeline();

  timeline.setCycleCount(1);
  timeline.setAutoReverse(true);

  final KeyValue[] kvArray = new KeyValue[2]; 
  kvArray[0] = new KeyValue(this.getNode().scaleXProperty(), 0);
  kvArray[1] = new KeyValue(this.getNode().scaleYProperty(), 0);
  final KeyFrame kf = new KeyFrame(Duration.millis(500), kvArray);

  timeline.getKeyFrames().add(kf);
  // here we call function from parameter
  timeline.setOnFinished(nextAction);
  timeline.play();
}

代码示例来源:origin: stackoverflow.com

double oldx = RBar.getX();
     double oldy = RBar.getY();
     double  moveval = oldacc + averageACC;
     double angle = -30 * Math.PI / 180;
     double newx = oldx - moveval * Math.sin(angle);
     double newy = oldy - moveval * Math.cos(angle);
     double  movex = newx + oldx;
     double movey = newy + oldy;
     Platform.runLater(new Runnable() {
       @Override
       public void run() {
         final Timeline timeline = new Timeline();
         timeline.setCycleCount(1);
         timeline.setAutoReverse(true);
         final KeyValue targetkvx = new KeyValue(RBar.translateXProperty(), movex);
         final KeyValue targetkvy = new KeyValue(RBar.translateYProperty(), movey);
         final KeyFrame kf = new KeyFrame(Duration.millis(100), targetkvx, targetkvy);
         timeline.getKeyFrames().add(kf);
         timeline.play();
       }
     });
     oldacc = averageACC;

代码示例来源:origin: stackoverflow.com

new KeyFrame(Duration.ZERO, new KeyValue(shadow.radiusProperty(), 0d)),
    new KeyFrame(Duration.seconds(0.15), new KeyValue(shadow.radiusProperty(), 20d)));
shadowAnimation.setAutoReverse(true);
shadowAnimation.setCycleCount(2);

代码示例来源:origin: stackoverflow.com

timelineX.setAutoReverse(false);
timelineX.play();
timelineY.setAutoReverse(false);
timelineY.play();

代码示例来源:origin: stackoverflow.com

});
timeline.setAutoReverse(true);
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();

代码示例来源:origin: stackoverflow.com

public class FXMLTimeController implements Initializable {

  @FXML
  private TextField txtTime;

  //timeline
  private Timeline timeline;

  private void showTime() {
    txtTime.setText((new Date()).toString());
  }

  @Override
  public void initialize(URL url, ResourceBundle rb) {
    timeline = new Timeline();
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.setAutoReverse(false);

    timeline.getKeyFrames().add(
        new KeyFrame(Duration.seconds(1),
            new EventHandler<ActionEvent>() {
              @Override public void handle(ActionEvent event) {
                showTime();
              }
            }));
    timeline.play();
  }

}

代码示例来源:origin: stackoverflow.com

Arc arc = ArcBuilder.create()
     .centerX(150)
     .centerY(150)
     .radiusX(100)
     .radiusY(50)
     .startAngle(0)
     .length(30)
     .type(ArcType.ROUND)
     .fill(Color.RED)
     .build();
 Pane root = new Pane();
 root.getChildren().add(arc);
 Scene scene = new Scene(root, 300, 250);
 primaryStage.setTitle("Hello Arc!");
 primaryStage.setScene(scene);
 primaryStage.show();
 KeyValue kv = new KeyValue(arc.startAngleProperty(), 360);
 KeyFrame kf = new KeyFrame(Duration.seconds(3), kv);
 Timeline timeline = new Timeline();
 timeline.setAutoReverse(false);
 timeline.setCycleCount(Timeline.INDEFINITE);
 timeline.getKeyFrames().add(kf);
 timeline.play();

代码示例来源:origin: stackoverflow.com

@Override
public void start(Stage primaryStage) {
  Circle circle = new Circle(300, 20, 5);
  Timeline animation = new Timeline(
      new KeyFrame(Duration.ZERO, new KeyValue(circle.centerYProperty(), circle.getCenterY())),
      new KeyFrame(Duration.seconds(1), new KeyValue(circle.centerYProperty(), 300))
  );
  animation.setCycleCount(Animation.INDEFINITE);
  animation.setAutoReverse(true);

  Button btn = new Button("Play");
  btn.pressedProperty().addListener((observable, wasPressed, pressed) -> {
    System.out.println("changed");
    if (pressed) {
      animation.play();
    } else {
      animation.pause();
    }
  });

  Pane root = new Pane(btn, circle);

  Scene scene = new Scene(root, 400, 400);

  primaryStage.setScene(scene);
  primaryStage.show();
}

代码示例来源:origin: stackoverflow.com

new KeyFrame(Duration.millis(500), new KeyValue(opacity, 0)));
flashAnimation.setCycleCount(Animation.INDEFINITE);
flashAnimation.setAutoReverse(true);

代码示例来源:origin: stackoverflow.com

final Timeline timeline = new Timeline();
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.setAutoReverse(false);
KeyValue xKV = new KeyValue(c.centerXProperty(), 500);
KeyValue yKV = new KeyValue(c.centerYProperty(), 100, new Interpolator() {

代码示例来源:origin: stackoverflow.com

timeline.setAutoReverse(true);
timeline.setCycleCount(Timeline.INDEFINITE);

代码示例来源:origin: com.jfoenix/jfoenix

});
timeline.setAutoReverse(creatorConfig.isAutoReverse());
timeline.setCycleCount(creatorConfig.getCycleCount());
timeline.setDelay(creatorConfig.getDelay());

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-preloader

private void animateWaitingLabel() {
 waitingLabel.translateYProperty().set(30);
 KeyValue kv = new KeyValue(waitingLabel.opacityProperty(), 0);
 Timeline timeline = new Timeline(new KeyFrame(Duration.millis(1000), kv));
 timeline.setCycleCount(Timeline.INDEFINITE);
 timeline.setAutoReverse(true);
 timeline.play();
}

代码示例来源:origin: stackoverflow.com

new KeyFrame(Duration.ZERO, new KeyValue(circle.centerYProperty(), circle.getCenterY())),
    new KeyFrame(duration, new KeyValue(circle.centerYProperty(), circle.getCenterY()+dy)));
animation.setAutoReverse(true);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();

代码示例来源:origin: stackoverflow.com

final Timeline timeline = new Timeline();
timeline.setCycleCount(Timeline.INDEFINITE);
timeline.setAutoReverse(true);
final KeyValue kv = new KeyValue(icon.opacityProperty(), 0.0);
final KeyFrame kf = new KeyFrame(Duration.millis(700), kv);

代码示例来源:origin: org.javafxdata/datafx-ui

timeline.setAutoReverse(false);

代码示例来源:origin: org.javafxdata/datafx-cell

timeline.setAutoReverse(false);

代码示例来源:origin: io.datafx/ui

timeline.setAutoReverse(false);

相关文章