当前位置: 首页>>代码示例>>Java>>正文


Java SequentialTransition类代码示例

本文整理汇总了Java中javafx.animation.SequentialTransition的典型用法代码示例。如果您正苦于以下问题:Java SequentialTransition类的具体用法?Java SequentialTransition怎么用?Java SequentialTransition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SequentialTransition类属于javafx.animation包,在下文中一共展示了SequentialTransition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActionSimulateGameMode

import javafx.animation.SequentialTransition; //导入依赖的package包/类
private void onActionSimulateGameMode(EGameMode gameMode) {
    DebugConsole.getDefault().debug(this.getClass(), "On Action simulate GameMode: " + gameMode.toString()); // NOI18N

    final SequentialTransition st = new SequentialTransition();
    st.setDelay(Duration.millis(125.0d));
    
    final PauseTransition ptStopGameMode = this.onActionStopGameMode();
    st.getChildren().add(ptStopGameMode);
    
    final FadeTransition ftHideGameInformations = this.onActionHideGameInformations();
    st.getChildren().add(ftHideGameInformations);
    
    final FadeTransition ftShowGameInformations = this.onActionShowGameInformations(gameMode);
    st.getChildren().add(ftShowGameInformations);
    
    final PauseTransition ptStartGameMode = this.onActionStartGameMode(gameMode);
    st.getChildren().add(ptStartGameMode);
    
    st.playFromStart();
}
 
开发者ID:Naoghuman,项目名称:Incubator,代码行数:21,代码来源:GameEngine.java

示例2: getAnimationLoseLife

import javafx.animation.SequentialTransition; //导入依赖的package包/类
private Animation getAnimationLoseLife(Texture texture) {
    texture.setFitWidth(64);
    texture.setFitHeight(64);

    Viewport viewport = gameScene.getViewport();

    TranslateTransition tt = new TranslateTransition(Duration.seconds(0.66), texture);
    tt.setToX(viewport.getWidth() / 2 - texture.getFitWidth() / 2);
    tt.setToY(viewport.getHeight() / 2 - texture.getFitHeight() / 2);

    ScaleTransition st = new ScaleTransition(Duration.seconds(0.66), texture);
    st.setToX(0);
    st.setToY(0);

    return new SequentialTransition(tt, st);
}
 
开发者ID:AlmasB,项目名称:FXGLGames,代码行数:17,代码来源:GameController.java

示例3: CardBox

import javafx.animation.SequentialTransition; //导入依赖的package包/类
public CardBox(final Card... CARDS) {
    super(CARDS);
    cards = FXCollections.observableArrayList();
    cards.addAll(CARDS);
    firstTime       = true;
    open            = new BooleanPropertyBase(false) {
        @Override protected void invalidated() { handleState(get()); }
        @Override public Object getBean() { return CardBox.this; }
        @Override public String getName() { return "open"; }
    };
    cardHandler     = e -> handleCardSelect((Card) e.getSource());
    selectedCard    = cards.size() == 0 ? null : cards.get(cards.size() - 1);
    openTransition  = new ParallelTransition();
    closeTransition = new SequentialTransition();
    initGraphics();
    registerListeners();
}
 
开发者ID:HanSolo,项目名称:cardnav,代码行数:18,代码来源:CardBox.java

示例4: showNotification

import javafx.animation.SequentialTransition; //导入依赖的package包/类
public void showNotification(String text)
{
	labelNotification.setText(text);
	labelNotification.setStyle("-fx-text-fill: #FFFFFF; -fx-font-size: 16; -fx-font-weight: bold; -fx-background-color: " + ConvertTo.toRGBHexWithoutOpacity(Colors.BACKGROUND_NOTIFICATION));
	FadeTransition fadeIn = new FadeTransition(Duration.millis(200), labelNotification);
	fadeIn.setFromValue(0.0);
	fadeIn.setToValue(1.0);

	FadeTransition fadeOut = new FadeTransition(Duration.millis(400), labelNotification);
	fadeOut.setFromValue(1.0);
	fadeOut.setToValue(0.0);
	fadeOut.setDelay(Duration.millis(3000));
	fadeOut.play();

	SequentialTransition seqT = new SequentialTransition(fadeIn, fadeOut);
	seqT.play();
	seqT.setOnFinished((a) -> {
		labelNotification.setStyle("-fx-text-fill: #FFFFFF; -fx-font-size: 16; -fx-font-weight: bold; -fx-background-color: transparent;");
	});
}
 
开发者ID:deadlocker8,项目名称:BudgetMaster,代码行数:21,代码来源:Controller.java

示例5: initController

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
protected void initController(boolean initialize) {
	stage.initStyle(StageStyle.TRANSPARENT);
	FadeTransition ft = new FadeTransition(Duration.millis(500), getStage().getScene().getRoot());
	ft.setFromValue(0.0);
	ft.setToValue(1.0);
	PauseTransition pt = new PauseTransition(Duration.millis(2000));

	FadeTransition ft2 = new FadeTransition(Duration.millis(1000),
			getRoot());
	ft2.setFromValue(1.0);
	ft2.setToValue(0.0);

	SequentialTransition st = new SequentialTransition(ft, pt, ft2);
	st.onFinishedProperty().set(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent actionEvent) {
			closeWindow();
			new LobbyController(SplashController.this).showWindow();
		}
	});
	st.playFromStart();
}
 
开发者ID:bdh92123,项目名称:share_all,代码行数:24,代码来源:SplashController.java

示例6: stopWorking

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public void stopWorking(Object key, String endMessage) {
    Platform.runLater(() -> {
        if (endMessage == null) {
            FadeTransition fade = new FadeTransition(Duration.seconds(1));
            fade.setFromValue(1);
            fade.setToValue(0);
            fade.setOnFinished(event -> {
                statusLabel.opacityProperty().set(1);
                statusLabel.setText(null);
            });
            SequentialTransition st = new SequentialTransition(statusLabel, new PauseTransition(Duration.seconds(5)), fade);
            st.play();
        } else {
            statusLabel.setText(endMessage);
            workList.addWorkData(key, endMessage);
            stopWorking(key, null);
        }
        workIndicator.setVisible(false);

    });
}
 
开发者ID:eriklarko,项目名称:robopong,代码行数:23,代码来源:ClientGuiController.java

示例7: downloadOccured

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public void downloadOccured(String url) {
	Label download = new Label(url);
	download.getStyleClass().add("download");
	downloads.getChildren().add(download);
	
	Timeline tlStayShown = new Timeline();
    KeyValue kvStayOpaque = new KeyValue(download.opacityProperty(), 1);
    KeyFrame kfStayOpaque = new KeyFrame(Duration.millis(2000), kvStayOpaque);
    tlStayShown.getKeyFrames().add(kfStayOpaque);
    
	Timeline tlDisappear = new Timeline();
    KeyValue kvDisappear = new KeyValue(download.opacityProperty(), 0);
    KeyFrame kfDisappear = new KeyFrame(Duration.millis(500), kvDisappear);
    tlDisappear.getKeyFrames().add(kfDisappear);

    SequentialTransition sequential = new SequentialTransition(tlStayShown, tlDisappear);
    sequential.setOnFinished((ae) -> downloads.getChildren().remove(download));
    sequential.play();
}
 
开发者ID:McFoggy,项目名称:fxnav-interceptor,代码行数:21,代码来源:DownloadPresenter.java

示例8: eval

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public Object eval(Environment env) {
    final Object c = ((ASTree) condition()).eval(env);
    if (c instanceof Integer) {
        final Sprite sprite = env.getSprite();
        SequentialTransition st = env.getSequentialTransition();
        TranslateTransition tt
                = new TranslateTransition(Duration.millis(10), sprite);
        tt.setOnFinished(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent t) {
                sprite.setSpriteCostume((int) c);
            }
        });
        st.getChildren().add(tt);
    }
    return c;
}
 
开发者ID:jointry,项目名称:jointry,代码行数:19,代码来源:CostumeStmnt.java

示例9: eval

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public Object eval(Environment env) {
    Sprite sprite = env.getSprite();
    SequentialTransition st = env.getSequentialTransition();
    ScaleTransition t = new ScaleTransition();

    int fromDirection = sprite.getDirection();
    t.setFromX(fromDirection);

    int toDirection = fromDirection * -1;
    t.setToX(toDirection);
 
     t.setNode(sprite);
     st.getChildren().add(t);

    sprite.setDirection(toDirection);
    return null;
}
 
开发者ID:jointry,项目名称:jointry,代码行数:19,代码来源:FlipStmnt.java

示例10: eval

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public Object eval(Environment env) {
    Object c = ((ASTree) condition()).eval(env);
    if (c instanceof Integer) {
        Sprite sprite = env.getSprite();
        SequentialTransition st = env.getSequentialTransition();
        System.out.println(env.getSpeed());
        TranslateTransition tt
                = new TranslateTransition(Duration.millis(env.getSpeed()), sprite);
        double x = sprite.moveBy((Integer) c);
        tt.setByX(x);
        env.setX(sprite.getX() + env.getX() + x);
        st.getChildren().add(tt);
    }
    return c;
}
 
开发者ID:jointry,项目名称:jointry,代码行数:17,代码来源:MoveStmnt.java

示例11: eval

import javafx.animation.SequentialTransition; //导入依赖的package包/类
@Override
public Object eval(Environment env) {
    final Object c = ((ASTree) condition()).eval(env);

    final Sprite sprite = env.getSprite();
    SequentialTransition st = env.getSequentialTransition();
    TranslateTransition tt
                        = new TranslateTransition(Duration.millis(10), sprite);
    tt.setOnFinished(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent t) {
            sprite.setSpeechBubble(c.toString());
        }
    });
    st.getChildren().add(tt);

    return c;
}
 
开发者ID:jointry,项目名称:jointry,代码行数:19,代码来源:SpeechStmnt.java

示例12: animateMergedTile

import javafx.animation.SequentialTransition; //导入依赖的package包/类
/**
 * Animation that creates a pop effect when two tiles merge
 * by increasing the tile scale to 120% at the middle, and then going back to 100% 
 * @param tile to be animated
 * @return a sequential transition 
 */
private SequentialTransition animateMergedTile(Tile tile) {
    final ScaleTransition scale0 = new ScaleTransition(ANIMATION_MERGED_TILE, tile);
    scale0.setToX(1.2);
    scale0.setToY(1.2);
    scale0.setInterpolator(Interpolator.EASE_IN);

    final ScaleTransition scale1 = new ScaleTransition(ANIMATION_MERGED_TILE, tile);
    scale1.setToX(1.0);
    scale1.setToY(1.0);
    scale1.setInterpolator(Interpolator.EASE_OUT);

    return new SequentialTransition(scale0, scale1);
}
 
开发者ID:juebanlin,项目名称:util4j,代码行数:20,代码来源:GameManager.java

示例13: enter

import javafx.animation.SequentialTransition; //导入依赖的package包/类
private void enter() {

        this.removeEventHandler(MouseEvent.MOUSE_ENTERED, enterEvent);

        hand.fireEvent(new net.gazeplay.games.creampie.event.TouchEvent(getCenterX(), getCenterY()));

        Timeline timeline = new Timeline();
        Timeline timeline2 = new Timeline();

        timeline.getKeyFrames()
                .add(new KeyFrame(new Duration(2000), new KeyValue(radiusProperty(), getInitialRadius() * 1.6)));
        timeline.getKeyFrames()
                .add(new KeyFrame(new Duration(2000), new KeyValue(rotateProperty(), getRotate() + (360 * 3))));
        timeline.getKeyFrames().add(new KeyFrame(new Duration(2000), new KeyValue(visibleProperty(), false)));

        timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(radiusProperty(), radius)));

        Position newPosition = randomPositionGenerator.newRandomPosition(getInitialRadius());

        timeline2.getKeyFrames()
                .add(new KeyFrame(new Duration(1), new KeyValue(centerXProperty(), newPosition.getX())));
        timeline2.getKeyFrames()
                .add(new KeyFrame(new Duration(1), new KeyValue(centerYProperty(), newPosition.getY())));
        timeline2.getKeyFrames().add(new KeyFrame(new Duration(1),
                new KeyValue(fillProperty(), new ImagePattern(pickRandomImage(availableImages), 0, 0, 1, 1, true))));
        timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(rotateProperty(), 0)));
        timeline2.getKeyFrames().add(new KeyFrame(new Duration(1000), new KeyValue(visibleProperty(), true)));

        SequentialTransition sequence = new SequentialTransition(timeline, timeline2);
        sequence.play();
        sequence.setOnFinished(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent actionEvent) {

                anniOff = true;
                stats.start();
            }
        });
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:41,代码来源:Target.java

示例14: touch

import javafx.animation.SequentialTransition; //导入依赖的package包/类
private void touch(TouchEvent te) {
    recomputePosition();

    Timeline timeline = new Timeline();
    Timeline timeline2 = new Timeline();

    timeline.getKeyFrames().add(new KeyFrame(new Duration(200), new KeyValue(hand.heightProperty(), size)));
    timeline.getKeyFrames().add(new KeyFrame(new Duration(200), new KeyValue(hand.widthProperty(), size)));
    timeline.getKeyFrames()
            .add(new KeyFrame(new Duration(2000), new KeyValue(pie.translateXProperty(), te.x - maxSize)));
    timeline.getKeyFrames()
            .add(new KeyFrame(new Duration(2000), new KeyValue(pie.translateYProperty(), te.y - maxSize)));
    timeline.getKeyFrames().add(new KeyFrame(new Duration(2000), new KeyValue(pie.heightProperty(), maxSize * 2)));
    timeline.getKeyFrames().add(new KeyFrame(new Duration(2000), new KeyValue(pie.widthProperty(), maxSize * 2)));
    timeline.getKeyFrames()
            .add(new KeyFrame(new Duration(2000), new KeyValue(pie.rotateProperty(), pie.getRotate() + 360)));

    timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(hand.heightProperty(), maxSize)));
    timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(hand.widthProperty(), maxSize)));
    timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(pie.heightProperty(), size)));
    timeline2.getKeyFrames().add(new KeyFrame(new Duration(1), new KeyValue(pie.widthProperty(), size)));
    timeline2.getKeyFrames()
            .add(new KeyFrame(new Duration(1), new KeyValue(hand.translateXProperty(), handTranslateX)));
    timeline2.getKeyFrames()
            .add(new KeyFrame(new Duration(1), new KeyValue(hand.translateYProperty(), handTranslateY)));
    timeline2.getKeyFrames()
            .add(new KeyFrame(new Duration(1), new KeyValue(pie.translateXProperty(), pieTranslateX)));
    timeline2.getKeyFrames()
            .add(new KeyFrame(new Duration(1), new KeyValue(pie.translateYProperty(), pieTranslateY)));

    SequentialTransition sequence = new SequentialTransition(timeline, timeline2);

    sequence.play();

    Utils.playSound("data/creampie/sounds/missile.mp3");
}
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:37,代码来源:Hand.java

示例15: AbstractAnimation

import javafx.animation.SequentialTransition; //导入依赖的package包/类
protected AbstractAnimation(CustomStage stage) {
    this.stage = stage;

    showAnimation = setupShowAnimation();
    dismissAnimation = setupDismissAnimation();

    sq = new SequentialTransition(setupShowAnimation(), setupDismissAnimation());
}
 
开发者ID:victorward,项目名称:recruitervision,代码行数:9,代码来源:AbstractAnimation.java


注:本文中的javafx.animation.SequentialTransition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。