本文整理匯總了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;
}