本文整理汇总了Java中javafx.animation.TimelineBuilder类的典型用法代码示例。如果您正苦于以下问题:Java TimelineBuilder类的具体用法?Java TimelineBuilder怎么用?Java TimelineBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TimelineBuilder类属于javafx.animation包,在下文中一共展示了TimelineBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindUpdates
import javafx.animation.TimelineBuilder; //导入依赖的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.TimelineBuilder; //导入依赖的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: FlashTransition
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
/**
* Create new FlashTransition
*
* @param node The node to affect
*/
public FlashTransition(final Node node) {
super(
node,
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 1, WEB_EASE)),
new KeyFrame(Duration.millis(250), new KeyValue(node.opacityProperty(), 0, WEB_EASE)),
new KeyFrame(Duration.millis(500), new KeyValue(node.opacityProperty(), 1, WEB_EASE)),
new KeyFrame(Duration.millis(750), new KeyValue(node.opacityProperty(), 0, WEB_EASE)),
new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 1, WEB_EASE))
)
.build()
);
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例4: takeHit
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
public void takeHit() {
if (!invincible) {
if (!small) {
setSmall();
invincible = true;
getNode().setOpacity(0.5);
TimelineBuilder.create()
.keyFrames(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
invincible = false;
getNode().setOpacity(1);
}
}))
.build()
.play();
} else {
state = new Dead(this);
}
}
}
示例5: run
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
public void run()
{
_isRunning = true;
final Duration oneFrameAmt = Duration.millis(1000 / _fps);
final KeyFrame oneFrame = new KeyFrame(oneFrameAmt,
new EventHandler<ActionEvent>()
{
@Override
public void handle(ActionEvent event)
{
_update();
}
}
);
_loop = TimelineBuilder.create().cycleCount(Animation.INDEFINITE).keyFrames(oneFrame).build();
play();
}
示例6: FlipInXTransition
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
/**
* Create new FlipInXTransition
*
* @param node The node to affect
*/
public FlipInXTransition(final Node node) {
super(
node,
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.rotateProperty(), -90, WEB_EASE),
new KeyValue(node.opacityProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(400),
new KeyValue(node.rotateProperty(), 10, WEB_EASE)
),
new KeyFrame(Duration.millis(700),
new KeyValue(node.rotateProperty(), -10, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.rotateProperty(), 0, WEB_EASE),
new KeyValue(node.opacityProperty(), 1, WEB_EASE)
)
)
.build()
);
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例7: ShakeTransition
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
/**
* Create new ShakeTransition
*
* @param node The node to affect
*/
public ShakeTransition(final Node node) {
super(
node,
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0), new KeyValue(node.translateXProperty(), 0, WEB_EASE)),
new KeyFrame(Duration.millis(100), new KeyValue(node.translateXProperty(), -10, WEB_EASE)),
new KeyFrame(Duration.millis(200), new KeyValue(node.translateXProperty(), 10, WEB_EASE)),
new KeyFrame(Duration.millis(300), new KeyValue(node.translateXProperty(), -10, WEB_EASE)),
new KeyFrame(Duration.millis(400), new KeyValue(node.translateXProperty(), 10, WEB_EASE)),
new KeyFrame(Duration.millis(500), new KeyValue(node.translateXProperty(), -10, WEB_EASE)),
new KeyFrame(Duration.millis(600), new KeyValue(node.translateXProperty(), 10, WEB_EASE)),
new KeyFrame(Duration.millis(700), new KeyValue(node.translateXProperty(), -10, WEB_EASE)),
new KeyFrame(Duration.millis(800), new KeyValue(node.translateXProperty(), 10, WEB_EASE)),
new KeyFrame(Duration.millis(900), new KeyValue(node.translateXProperty(), -10, WEB_EASE)),
new KeyFrame(Duration.millis(1000), new KeyValue(node.translateXProperty(), 0, WEB_EASE))
)
.build()
);
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例8: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
double startY = -node.localToScene(0, 0).getY() -node.getBoundsInParent().getHeight();
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.translateYProperty(), startY, WEB_EASE)
),
new KeyFrame(Duration.millis(600),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.translateYProperty(), 30, WEB_EASE)
),
new KeyFrame(Duration.millis(800),
new KeyValue(node.translateYProperty(), -10, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.translateYProperty(), 0, WEB_EASE)
)
)
.build();
super.starting();
}
示例9: FlipOutXTransition
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
/**
* Create new FlipOutXTransition
*
* @param node The node to affect
*/
public FlipOutXTransition(final Node node) {
super(
node,
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.rotateProperty(), 0, WEB_EASE),
new KeyValue(node.opacityProperty(), 1, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.rotateProperty(), -90, WEB_EASE),
new KeyValue(node.opacityProperty(), 0, WEB_EASE)
)
)
.build()
);
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例10: RotateOutTransition
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
/**
* Create new RotateOutTransition
*
* @param node The node to affect
*/
public RotateOutTransition(final Node node) {
super(
node,
TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.rotateProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.rotateProperty(), 200, WEB_EASE)
)
)
.build());
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例11: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
double endX = -node.localToScene(0, 0).getX() -node.getBoundsInParent().getWidth();
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.translateXProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(200),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.translateXProperty(), 20, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.translateXProperty(), endX, WEB_EASE)
)
)
.build();
super.starting();
}
示例12: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
double endX = node.getScene().getWidth() - node.localToScene(0, 0).getX();
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.translateXProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.translateXProperty(), endX, WEB_EASE)
)
)
.build();
super.starting();
}
示例13: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
double endX = -node.localToScene(0, 0).getX() -node.getBoundsInParent().getWidth();
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(node.translateXProperty(), 0, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(node.translateXProperty(), endX, WEB_EASE)
)
)
.build();
super.starting();
}
示例14: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
super.starting();
rotate = new Rotate(0,0,node.getBoundsInLocal().getHeight());
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(rotate.angleProperty(), -90, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
)
)
.build();
node.getTransforms().add(rotate);
}
示例15: starting
import javafx.animation.TimelineBuilder; //导入依赖的package包/类
@Override protected void starting() {
super.starting();
rotate = new Rotate(0,
node.getBoundsInLocal().getWidth(),
node.getBoundsInLocal().getHeight());
timeline = TimelineBuilder.create()
.keyFrames(
new KeyFrame(Duration.millis(0),
new KeyValue(node.opacityProperty(), 0, WEB_EASE),
new KeyValue(rotate.angleProperty(), 90, WEB_EASE)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.opacityProperty(), 1, WEB_EASE),
new KeyValue(rotate.angleProperty(), 0, WEB_EASE)
)
)
.build();
node.getTransforms().add(rotate);
}