本文整理汇总了Java中javafx.animation.Timeline.playFromStart方法的典型用法代码示例。如果您正苦于以下问题:Java Timeline.playFromStart方法的具体用法?Java Timeline.playFromStart怎么用?Java Timeline.playFromStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.animation.Timeline
的用法示例。
在下文中一共展示了Timeline.playFromStart方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindUpdates
import javafx.animation.Timeline; //导入方法依赖的package包/类
private void bindUpdates() {
final KeyFrame oneFrame = new KeyFrame(Duration.seconds(1), (ActionEvent evt) -> {
if (this.batpack != null) {
this.batpack = BatteryMonitorSystem.getBatpack();
//System.out.println("layout: battery pack module 5 cell 5 voltage: " + batpack.getModules().get(4).getBatteryCells().get(4).getVoltageAsString());
checkConnection();
updateModules();
updateTotalVoltage();
updateMaxTemperature();
updateCriticalValues();
}
});
Timeline timer = TimelineBuilder.create().cycleCount(Animation.INDEFINITE).keyFrames(oneFrame).build();
timer.playFromStart();
}
示例2: showLoading
import javafx.animation.Timeline; //导入方法依赖的package包/类
private void showLoading() {
final KeyFrame oneFrame = new KeyFrame(Duration.millis(750), (ActionEvent evt) -> {
loading.setText(getNextLoadingText());
//bms.setText(getNextBmsText());
});
Timeline timer = TimelineBuilder.create().cycleCount(Animation.INDEFINITE).keyFrames(oneFrame).build();
timer.playFromStart();
}
示例3: startPanAnimation
import javafx.animation.Timeline; //导入方法依赖的package包/类
private void startPanAnimation(double velocity, Timeline timeline, DoubleProperty animatedPan, DoubleProperty pan) {
if (isRunning(timeline)) {
return;
}
double durationInMillis = 1e10;
double distance = velocity * durationInMillis;
animatedPan.set(pan.get());
KeyValue keyValue = new KeyValue(animatedPan, animatedPan.get() - distance);
KeyFrame keyFrame = new KeyFrame(Duration.millis(durationInMillis), keyValue);
timeline.getKeyFrames().setAll(keyFrame);
timeline.playFromStart();
}
示例4: addSampleEditorTab
import javafx.animation.Timeline; //导入方法依赖的package包/类
private void addSampleEditorTab() {
Timeline sample = new Timeline(new KeyFrame(Duration.ONE, event -> createAndAddNewEditorTab(new File(Utils.getDefaultFileName()), Utils.getSampleText())));
sample.playFromStart();
}
示例5: timelineController
import javafx.animation.Timeline; //导入方法依赖的package包/类
private Timeline timelineController(){
Timeline timeline = new Timeline();
timeline.getKeyFrames().add(new KeyFrame(Duration.seconds(START_TIME), e -> eventHandle()));
timeline.getKeyFrames().add(
new KeyFrame(Duration.seconds(START_TIME),
new KeyValue(timeSeconds, 0)));
timeline.playFromStart();
return timeline;
}