當前位置: 首頁>>代碼示例>>Java>>正文


Java Interpolator.EASE_OUT屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:juebanlin,項目名稱:util4j,代碼行數:21,代碼來源:GameManager.java

示例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));
}
 
開發者ID:EricCanull,項目名稱:fxexperience2,代碼行數:30,代碼來源:FlipTransition.java

示例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();
}
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:20,代碼來源:FlipPanel.java

示例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();
}
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:20,代碼來源:FlipPanel.java

示例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();
}
 
開發者ID:Grant-Redmond,項目名稱:cryptwallet,代碼行數:19,代碼來源:NotificationBarPane.java

示例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))
    );
}
 
開發者ID:NonlinearFruit,項目名稱:Retrospector,代碼行數:16,代碼來源:RollOver.java

示例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;
}
 
開發者ID:teamfx,項目名稱:openjfx-8u-dev-tests,代碼行數:21,代碼來源:AnimationApp.java

示例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));
}
 
開發者ID:jfoenixadmin,項目名稱:JFoenix,代碼行數:16,代碼來源:CenterTransition.java

示例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));
}
 
開發者ID:jfoenixadmin,項目名稱:JFoenix,代碼行數:16,代碼來源:HorizontalTransition.java

示例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));
}
 
開發者ID:jfoenixadmin,項目名稱:JFoenix,代碼行數:16,代碼來源:VerticalTransition.java

示例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;
}
 
開發者ID:jperedadnr,項目名稱:Game2048FX,代碼行數:21,代碼來源:GameManager.java

示例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();
}
 
開發者ID:cis422s14team5,項目名稱:WatchlistPro,代碼行數:17,代碼來源:TabPaneSkinHack.java

示例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();
}
 
開發者ID:ewidgetfx,項目名稱:ewidgetfx,代碼行數:17,代碼來源:IconSwipeListPane.java

示例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);
}
 
開發者ID:Simego,項目名稱:FXImgurUploader,代碼行數:28,代碼來源:RadialMenu.java

示例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);
}
 
開發者ID:Simego,項目名稱:FXImgurUploader,代碼行數:28,代碼來源:RadialMenu.java


注:本文中的javafx.animation.Interpolator.EASE_OUT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。