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

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

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

Timeline.setRate介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

private void initListeners() {
  // delegate slider mouse events to track node
  mouseHandlerPane.setOnMousePressed(this::delegateToTrack);
  mouseHandlerPane.setOnMouseReleased(this::delegateToTrack);
  mouseHandlerPane.setOnMouseDragged(this::delegateToTrack);
  // animate value node
  track.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> {
    timeline.setRate(1);
    timeline.play();
  });
  track.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> {
    timeline.setRate(-1);
    timeline.play();
  });
  thumb.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> {
    timeline.setRate(1);
    timeline.play();
  });
  thumb.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> {
    timeline.setRate(-1);
    timeline.play();
  });
  refreshSliderValueBinding();
  updateValueStyleClass();
  getSkinnable().valueProperty().addListener(observable -> updateValueStyleClass());
  getSkinnable().orientationProperty().addListener(observable -> initAnimation(getSkinnable().getOrientation()));
}

代码示例来源:origin: jfoenixadmin/JFoenix

public void togglePane() {
  if (toggleAnimation == null) {
    updateToggleAnimation();
  }
  this.getClip().scaleXProperty().unbind();
  this.getClip().scaleYProperty().unbind();
  toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
    toggleAnimation.playFrom(Duration.millis(510));
  } else {
    toggleAnimation.play();
  }
}

代码示例来源:origin: jfoenixadmin/JFoenix

toggleAnimation.setRate(animationRate);

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

counter.addListener((observable, oldValue, newValue) -> {
  double currentRate = timeline.getRate();
  timeline.setRate(currentRate + currentRate * SPEED_UP_FACTOR); // speed up count down
  System.out.println(newValue);
});

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

if (ke.getCode() == KeyCode.RIGHT) {
  rotationAnimation.play();
  rotationAnimation.setRate(1);
} else if (ke.getCode() == KeyCode.LEFT) {
  rotationAnimation.play();
  rotationAnimation.setRate(-1);

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

new KeyFrame(Duration.seconds(1), new KeyValue(brightness, 1d))
);
timeline.setOnFinished(evt -> timeline.setRate(-timeline.getRate()));

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

private void initListeners() {
  // delegate slider mouse events to track node
  mouseHandlerPane.setOnMousePressed(this::delegateToTrack);
  mouseHandlerPane.setOnMouseReleased(this::delegateToTrack);
  mouseHandlerPane.setOnMouseDragged(this::delegateToTrack);
  // animate value node
  track.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> {
    timeline.setRate(1);
    timeline.play();
  });
  track.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> {
    timeline.setRate(-1);
    timeline.play();
  });
  thumb.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> {
    timeline.setRate(1);
    timeline.play();
  });
  thumb.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> {
    timeline.setRate(-1);
    timeline.play();
  });
  refreshSliderValueBinding();
  updateValueStyleClass();
  getSkinnable().valueProperty().addListener(observable -> updateValueStyleClass());
  getSkinnable().orientationProperty().addListener(observable -> initAnimation(getSkinnable().getOrientation()));
}

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

timeline.setCycleCount(creatorConfig.getCycleCount());
timeline.setDelay(creatorConfig.getDelay());
timeline.setRate(creatorConfig.getRate());
timeline.setOnFinished(creatorConfig::handleOnFinish);

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

distorter.setRate(1);
 distorter.play();
} else {
 distorter.setRate(-1);
 distorter.play();

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

animation = createAnimation();
animation.setRate( flippedProperty.get() ? ANIMATION_RATE : -ANIMATION_RATE );

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

animation.setRate(animation.getRate() + 100);
animation.setRate(
  animation.getRate() > 0 ? animation.getRate() - 100 : 0);

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

public void togglePane() {
  if (toggleAnimation == null) {
    updateToggleAnimation();
  }
  this.getClip().scaleXProperty().unbind();
  this.getClip().scaleYProperty().unbind();
  toggleAnimation.setRate(toggleAnimation.getRate() * -1);
  if (toggleAnimation.getCurrentTime().equals(Duration.millis(0)) && toggleAnimation.getRate() == -1) {
    toggleAnimation.playFrom(Duration.millis(510));
  } else {
    toggleAnimation.play();
  }
}

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

toggleAnimation.setRate(animationRate);

相关文章