本文整理汇总了Java中javafx.animation.ScaleTransitionBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ScaleTransitionBuilder类的具体用法?Java ScaleTransitionBuilder怎么用?Java ScaleTransitionBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScaleTransitionBuilder类属于javafx.animation包,在下文中一共展示了ScaleTransitionBuilder类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ScaleTransitionSample
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
public ScaleTransitionSample() {
super(150,150);
Rectangle rect = new Rectangle(50, 50, 50, 50);
rect.setArcHeight(15);
rect.setArcWidth(15);
rect.setFill(Color.ORANGE);
getChildren().add(rect);
scaleTransition = ScaleTransitionBuilder.create()
.node(rect)
.duration(Duration.seconds(4))
.toX(3)
.toY(3)
.cycleCount(Timeline.INDEFINITE)
.autoReverse(true)
.build();
}
示例2: buildTextPartAnimation
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
/**
* Builds the text part animation.
*
* @param textNode the text node
* @return the animation
*/
private Animation buildTextPartAnimation(final Text textNode) {
return ParallelTransitionBuilder.create()
.node(textNode)
.children(
ScaleTransitionBuilder.create()
.duration(Duration.millis(300)) // SHOULD BE CONFIGURABLE (Game Speed)
.fromX(0.0).toX(1.0)
.fromY(0.0).toY(1.0)
.build())
.build();
}
示例3: buildExpressionResolved
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
/**
* Gets the expression resolved.
*
* @return the expression resolved
*/
private Animation buildExpressionResolved() {
return ParallelTransitionBuilder.create()
.delay(Duration.millis(400))
.children(
ScaleTransitionBuilder.create()
.node(this.result)
.fromX(1).toX(4.0)
.fromY(1).toY(4.0)
.build(),
ScaleTransitionBuilder.create()
.node(getLeftOperand())
.fromX(1).toX(0)
.fromY(1).toY(0)
.build(),
ScaleTransitionBuilder.create()
.node(getOperator())
.fromX(1).toX(0)
.fromY(1).toY(0)
.build(),
ScaleTransitionBuilder.create()
.node(getRightOperand())
.fromX(1).toX(0)
.fromY(1).toY(0)
.build(),
ScaleTransitionBuilder.create()
.node(getEquality())
.fromX(1).toX(0)
.fromY(1).toY(0)
.build())
.build();
}
示例4: buildExpressionFailure
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
/**
* Gets the expression failure.
*
* @return the expression failure
*/
private Animation buildExpressionFailure() {
return ScaleTransitionBuilder.create()
.delay(Duration.millis(500))
.node(getResult())
.fromX(1).toX(0.0)
.fromY(1).toY(0.0)
.duration(Duration.millis(400))
.build();
}
示例5: buildBeanAnimation
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
/**
* Build a bean animation.
*
* @param label the attached label
* @param shape the shape to show
* @param fillColor the color to use to paint the shape
*
* @return the bean animation
*/
private Animation buildBeanAnimation(final Label label, final Shape shape, final Color fillColor) {
return ParallelTransitionBuilder.create()
.children(
ScaleTransitionBuilder.create().node(label).delay(Duration.millis(50)).duration(Duration.millis(300))
.fromX(0).fromY(0).toX(1).toY(1).build(),
FillTransitionBuilder.create().shape(shape)
.fromValue(Color.LIGHTGREY).toValue(fillColor)
.build())
.build();
}
示例6: handle
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
public void handle(ActionEvent t) {
double parentRot = slide.getParent().getParent().getRotate();
double parentScale = slide.getParent().getParent().getScaleX();
if (parentScale != PresentationController.SCALE) {
ScaleTransitionBuilder.create()
.node(slide.getParent().getParent())
.toX(PresentationController.SCALE)
.toY(PresentationController.SCALE)
.duration(Duration.millis(600))
.onFinished(this)
.build().play();
} else if (parentRot != PresentationController.getRotation(slide.getRotate())) {
RotateTransitionBuilder.create()
.toAngle(PresentationController.getRotation(slide.getRotate()))
.node(slide.getParent().getParent())
.onFinished(this)
.duration(Duration.millis(600)).build().play();
} else {
Bounds point = slide.localToScene(slide.getBoundsInLocal());
double nowX = point.getMinX();
double nowY = point.getMinY();
TranslateTransitionBuilder.create()
.node(slide.getParent().getParent())
.byX(-nowX)
.byY(-nowY)
.interpolator(Interpolator.EASE_OUT)
.duration(Duration.millis(600))
.onFinished(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent arg0) {
slide.toFront();
onFinished.handle(arg0);
}
})
.build().play();
}
}
开发者ID:NitorCreations,项目名称:javaone-shanghai-2013-javafx-presentation,代码行数:40,代码来源:FinishAnimator.java
示例7: setDockFeedbackVisible
import javafx.animation.ScaleTransitionBuilder; //导入依赖的package包/类
/**
* Activate dock feedback on screen's bounds
*
* @param x
* @param y
*/
public void setDockFeedbackVisible(double x, double y, double width, double height) {
dockFeedback.setVisible(true);
dockFeedback.setLayoutX(x);
dockFeedback.setLayoutY(y);
dockFeedback.setWidth(width);
dockFeedback.setHeight(height);
FadeTransition fadeTransition = FadeTransitionBuilder.create()
.duration(Duration.millis(100))
.node(dockFeedback)
.fromValue(0)
.toValue(1)
.autoReverse(true)
.cycleCount(4)
.build();
ScaleTransition scaleTransition = ScaleTransitionBuilder.create()
.duration(Duration.millis(400))
.node(dockFeedback)
.fromX(0.4)
.fromY(0.4)
.toX(1)
.toY(1)
.build();
parallelTransition = new ParallelTransition(dockFeedback);
parallelTransition.getChildren().addAll(fadeTransition, scaleTransition);
parallelTransition.setOnFinished(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
dockFeedback.setVisible(false);
}
});
parallelTransition.play();
}