本文整理汇总了Java中javafx.animation.Interpolator.EASE_OUT属性的典型用法代码示例。如果您正苦于以下问题:Java Interpolator.EASE_OUT属性的具体用法?Java Interpolator.EASE_OUT怎么用?Java Interpolator.EASE_OUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.animation.Interpolator
的用法示例。
在下文中一共展示了Interpolator.EASE_OUT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: animateExistingTile
/**
* Animation that moves the tile from its previous location to a new location
* @param tile to be animated
* @param newLocation new location of the tile
* @return a timeline
*/
private Timeline animateExistingTile(Tile tile, Location newLocation) {
Timeline timeline = new Timeline();
KeyValue kvX = new KeyValue(tile.layoutXProperty(),
newLocation.getLayoutX(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);
KeyValue kvY = new KeyValue(tile.layoutYProperty(),
newLocation.getLayoutY(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);
KeyFrame kfX = new KeyFrame(ANIMATION_EXISTING_TILE, kvX);
KeyFrame kfY = new KeyFrame(ANIMATION_EXISTING_TILE, kvY);
timeline.getKeyFrames().add(kfX);
timeline.getKeyFrames().add(kfY);
return timeline;
}
示例2: FlipTransition
/**
* Create new FlipTransition
*
* @param node The node to affect
*/
public FlipTransition(final Node node) {
super(node, new Timeline(
new KeyFrame(Duration.millis(0),
new KeyValue(node.rotateProperty(), 0, Interpolator.EASE_OUT),
new KeyValue(node.translateZProperty(), 0, Interpolator.EASE_OUT)),
new KeyFrame(Duration.millis(400),
new KeyValue(node.translateZProperty(), -150, Interpolator.EASE_OUT),
new KeyValue(node.rotateProperty(), -170, Interpolator.EASE_OUT)),
new KeyFrame(Duration.millis(500),
new KeyValue(node.translateZProperty(), -150, Interpolator.EASE_IN),
new KeyValue(node.rotateProperty(), -190, Interpolator.EASE_IN),
new KeyValue(node.scaleXProperty(), 1, Interpolator.EASE_IN),
new KeyValue(node.scaleYProperty(), 1, Interpolator.EASE_IN)),
new KeyFrame(Duration.millis(800),
new KeyValue(node.translateZProperty(), 0, Interpolator.EASE_IN),
new KeyValue(node.rotateProperty(), -360, Interpolator.EASE_IN),
new KeyValue(node.scaleXProperty(), 0.95, Interpolator.EASE_IN),
new KeyValue(node.scaleYProperty(), 0.95, Interpolator.EASE_IN)),
new KeyFrame(Duration.millis(1000),
new KeyValue(node.scaleXProperty(), 1, Interpolator.EASE_IN),
new KeyValue(node.scaleYProperty(), 1, Interpolator.EASE_IN))));
this.flipNode = node;
setCycleDuration(Duration.seconds(1));
setDelay(Duration.seconds(0.2));
}
示例3: flipToFront
public void flipToFront() {
if (Double.compare(rotate.getAngle(), 0) == 0) return;
KeyValue kvStart = new KeyValue(rotate.angleProperty(), 180, Interpolator.EASE_IN);
KeyValue kvStop = new KeyValue(rotate.angleProperty(), 0, Interpolator.EASE_OUT);
KeyFrame kfStart = new KeyFrame(Duration.ZERO, kvStart);
KeyFrame kfStop = new KeyFrame(Duration.millis(flipTime), kvStop);
flipToFront.getKeyFrames().setAll(kfStart, kfStop);
front.setCache(true);
front.setCacheHint(CacheHint.ROTATE);
back.setCache(true);
back.setCacheHint(CacheHint.ROTATE);
flipToFront.setOnFinished(event -> {
front.setCache(false);
back.setCache(false);
fireEvent(new FlipEvent(FlipPanel.this, FlipPanel.this, FlipEvent.FLIP_TO_FRONT_FINISHED));
});
flipToFront.play();
}
示例4: flipToBack
public void flipToBack() {
if (Double.compare(rotate.getAngle(), 180) == 0) return;
KeyValue kvStart = new KeyValue(rotate.angleProperty(), 0, Interpolator.EASE_IN);
KeyValue kvStop = new KeyValue(rotate.angleProperty(), 180, Interpolator.EASE_OUT);
KeyFrame kfStart = new KeyFrame(Duration.ZERO, kvStart);
KeyFrame kfStop = new KeyFrame(Duration.millis(flipTime), kvStop);
flipToBack.getKeyFrames().setAll(kfStart, kfStop);
front.setCache(true);
front.setCacheHint(CacheHint.ROTATE);
back.setCache(true);
back.setCacheHint(CacheHint.ROTATE);
flipToBack.setOnFinished(event -> {
front.setCache(false);
back.setCache(false);
fireEvent(new FlipEvent(FlipPanel.this, FlipPanel.this, FlipEvent.FLIP_TO_BACK_FINISHED));
});
flipToBack.play();
}
示例5: animate
protected void animate(Number target) {
if (timeline != null) {
timeline.stop();
timeline = null;
}
Duration duration;
Interpolator interpolator;
if (target.intValue() > 0) {
interpolator = new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2);
duration = ANIM_IN_DURATION;
} else {
interpolator = Interpolator.EASE_OUT;
duration = ANIM_OUT_DURATION;
}
KeyFrame kf = new KeyFrame(duration, new KeyValue(bar.prefHeightProperty(), target, interpolator));
timeline = new Timeline(kf);
timeline.setOnFinished(x -> timeline = null);
timeline.play();
}
示例6: createAnimation
private Timeline createAnimation() {
return new Timeline(
new KeyFrame(Duration.millis(0), new KeyValue(angle, HALF_PIE)),
new KeyFrame(Duration.millis(ANIMATION_DURATION / 2), new KeyValue(angle, 0, Interpolator.EASE_IN)),
new KeyFrame(Duration.millis(ANIMATION_DURATION / 2), new EventHandler<ActionEvent>() {
@Override
public void handle(final ActionEvent arg0) {
// TODO -- Do they another way or API to do this?
flippedProperty.set(flippedProperty.not().get());
}
}),
new KeyFrame(Duration.millis(ANIMATION_DURATION / 2), new KeyValue(angle, PIE)),
new KeyFrame(Duration.millis(ANIMATION_DURATION), new KeyValue(angle, HALF_PIE, Interpolator.EASE_OUT))
);
}
示例7: drawNode
@Override
public Node drawNode() {
Pane p = pre();
//create a timeline for moving the circle
timeline.setCycleCount(1);
timeline.setAutoReverse(true);
keyValue1 = new KeyValue(circle.translateXProperty(), 300, Interpolator.EASE_OUT);
keyValue2 = new KeyValue(circle.translateYProperty(), 200, Interpolator.EASE_IN);
AnimationBooleanInterpolator boolInterp = new AnimationBooleanInterpolator();
keyValue3 = new KeyValue(circle.visibleProperty(), false, boolInterp);
KeyFrame keyFrame1 = new KeyFrame(duration, onFinish, keyValue1 , keyValue2);
timeline.getKeyFrames().add(keyFrame1);
KeyFrame keyFrame3 = new KeyFrame(duration, keyValue3);
timeline.getKeyFrames().add(keyFrame3);
return p;
}
示例8: CenterTransition
public CenterTransition(Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR),
new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT),
new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
示例9: HorizontalTransition
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateXProperty(),
(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())
* (leftDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
示例10: VerticalTransition
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) {
super(contentContainer, new Timeline(
new KeyFrame(Duration.ZERO,
new KeyValue(contentContainer.translateYProperty(),
(contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY())
* (topDirection? -1 : 1), Interpolator.LINEAR),
new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH)
),
new KeyFrame(Duration.millis(1000),
new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH),
new KeyValue(contentContainer.translateYProperty(), 0, Interpolator.EASE_OUT)
)));
// reduce the number to increase the shifting , increase number to reduce shifting
setCycleDuration(Duration.seconds(0.4));
setDelay(Duration.seconds(0));
}
示例11: animateExistingTile
/**
* Animation that moves the tile from its previous location to a new location
* @param tile to be animated
* @param newLocation new location of the tile
* @return a timeline
*/
private Timeline animateExistingTile(Tile tile, Location newLocation) {
Timeline timeline = new Timeline();
KeyValue kvX = new KeyValue(tile.layoutXProperty(),
newLocation.getLayoutX(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);
KeyValue kvY = new KeyValue(tile.layoutYProperty(),
newLocation.getLayoutY(Board.CELL_SIZE) - (tile.getMinHeight() / 2), Interpolator.EASE_OUT);
KeyFrame kfX = new KeyFrame(Duration.millis(65), kvX);
KeyFrame kfY = new KeyFrame(Duration.millis(65), kvY);
timeline.getKeyFrames().add(kfX);
timeline.getKeyFrames().add(kfY);
return timeline;
}
示例12: showControlButtons
private void showControlButtons() {
double prefHeight = snapSize(prefHeight(-1));
Timeline timeline = new Timeline();
KeyValue keyValue = new KeyValue(controlTabHeight, prefHeight, Interpolator.EASE_OUT);
setVisible(true);
timeline.getKeyFrames().clear();
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(ANIMATION_SPEED), new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent event) {
if (popup == null) {
setupPopupMenu();
}
requestLayout();
}
}, keyValue));
timeline.play();
}
示例13: animStart
protected void animStart(double delta) {
if (dragDelta.doubleValue() > 5 && dragDelta.doubleValue() < -5) {
return;
}
if (noScroll.get()) {
return;
}
DoubleProperty endScrollValue = new SimpleDoubleProperty();
endScrollValue.set(restrainScrolling(scroll.doubleValue() + delta * 15));
if (dragTimeLine != null) {
dragTimeLine.stop();
}
dragTimeLine = new Timeline(
new KeyFrame(Duration.millis(800),
new KeyValue(scroll, endScrollValue.get(), Interpolator.EASE_OUT)));
dragTimeLine.playFromStart();
}
示例14: createItemOpenTimeLine
private Timeline createItemOpenTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
KeyValue kvX1 = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvY1 = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvR1 = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvO1 = new KeyValue(NODE.opacityProperty(), 0.0, Interpolator.EASE_OUT);
KeyValue kvX2 = new KeyValue(NODE.translateXProperty(), 0.0);
KeyValue kvY2 = new KeyValue(NODE.translateYProperty(), 0.0);
KeyValue kvX3 = new KeyValue(NODE.translateXProperty(), 1.1 * X, Interpolator.EASE_IN);
KeyValue kvY3 = new KeyValue(NODE.translateYProperty(), 1.1 * Y, Interpolator.EASE_IN);
KeyValue kvX4 = new KeyValue(NODE.translateXProperty(), 0.95 * X, Interpolator.EASE_OUT);
KeyValue kvY4 = new KeyValue(NODE.translateYProperty(), 0.95 * Y, Interpolator.EASE_OUT);
KeyValue kvRO4 = new KeyValue(NODE.rotateProperty(), 360);
KeyValue kvO4 = new KeyValue(NODE.opacityProperty(), 1.0, Interpolator.EASE_OUT);
KeyValue kvX5 = new KeyValue(NODE.translateXProperty(), X);
KeyValue kvY5 = new KeyValue(NODE.translateYProperty(), Y);
KeyFrame kfO1 = new KeyFrame(Duration.millis(0), kvX1, kvY1, kvR1, kvO1);
KeyFrame kfO2 = new KeyFrame(Duration.millis(50 + DELAY), kvX2, kvY2);
KeyFrame kfO3 = new KeyFrame(Duration.millis(250 + DELAY), kvX3, kvY3);
KeyFrame kfO4 = new KeyFrame(Duration.millis(400 + DELAY), kvX4, kvY4, kvRO4, kvO4);
KeyFrame kfO5 = new KeyFrame(Duration.millis(550 + DELAY), kvX5, kvY5);
return new Timeline(kfO1, kfO2, kfO3, kfO4, kfO5);
}
示例15: createItemCloseTimeLine
private Timeline createItemCloseTimeLine(final StackPane NODE, final double X, final double Y, final double DELAY) {
KeyValue kvX1 = new KeyValue(NODE.translateXProperty(), X);
KeyValue kvY1 = new KeyValue(NODE.translateYProperty(), Y);
KeyValue kvRC2 = new KeyValue(NODE.rotateProperty(), 720);
KeyValue kvX3 = new KeyValue(NODE.translateXProperty(), X, Interpolator.EASE_IN);
KeyValue kvY3 = new KeyValue(NODE.translateYProperty(), Y, Interpolator.EASE_IN);
KeyValue kvX4 = new KeyValue(NODE.translateXProperty(), 0);
KeyValue kvY4 = new KeyValue(NODE.translateYProperty(), 0);
KeyValue kvX5 = new KeyValue(NODE.translateXProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvY5 = new KeyValue(NODE.translateYProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvR5 = new KeyValue(NODE.rotateProperty(), 0, Interpolator.EASE_OUT);
KeyValue kvO5 = new KeyValue(NODE.opacityProperty(), 0.5);
KeyValue kvO6 = new KeyValue(NODE.opacityProperty(), 0);
KeyFrame kfC1 = new KeyFrame(Duration.millis(0), kvX1, kvY1);
KeyFrame kfC2 = new KeyFrame(Duration.millis(50 + DELAY), kvRC2);
KeyFrame kfC3 = new KeyFrame(Duration.millis(250 + DELAY), kvX3, kvY3);
KeyFrame kfC4 = new KeyFrame(Duration.millis(400 + DELAY), kvX4, kvY4);
KeyFrame kfC5 = new KeyFrame(Duration.millis(550 + DELAY), kvX5, kvY5, kvR5, kvO5);
KeyFrame kfC6 = new KeyFrame(Duration.millis(551 + DELAY), kvO6);
return new Timeline(kfC1, kfC2, kfC3, kfC4, kfC5, kfC6);
}