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


Java Transition.setCycleCount方法代码示例

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


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

示例1: BasicEdgeRenderer

import javafx.animation.Transition; //导入方法依赖的package包/类
public BasicEdgeRenderer() {

       // line.setStroke(colorUnpicked);
        line.strokeProperty().bind(arrowStrokePaintProperty);
        arrowShape.fillProperty().bind(arrowHeadFillProperty);

        //animator = new StrokeTransition(Duration.millis(animationTime), arrowStrokePaintProperty, Color.WHITE);

        animator = new Transition() {
            {
                setCycleDuration(Duration.millis(animationTime));
            }
            protected void interpolate(double frac) {

                arrowStrokePaintProperty.set(currentEdgeStrokePaint.interpolate(currentAnimationEndColor, frac));
                arrowHeadFillProperty.set(currentArrowFill.interpolate(currentAnimationEndColor, frac));
            }
        };
        animator.setCycleCount(2);
        animator.setAutoReverse(true);
    }
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:22,代码来源:BasicEdgeRenderer.java

示例2: MulticastEdgeRenderer

import javafx.animation.Transition; //导入方法依赖的package包/类
public MulticastEdgeRenderer() {

        circle.setFill(Color.WHITE);
        circle.setVisible(false);



        animator = new Transition() {

            {
                setCycleDuration(Duration.millis(animationTime));
            }

            @Override
            protected void interpolate(double frac) {

                circle.setRadius(frac * 1000);
                circle.setOpacity(1 - frac);

            }
        };
        animator.setCycleCount(2);
        animator.setOnFinished(e -> {
            circle.setVisible(false);
        });
    }
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:27,代码来源:MulticastEdgeRenderer.java

示例3: AnimatedCameraController

import javafx.animation.Transition; //导入方法依赖的package包/类
public AnimatedCameraController(AnimationPreference movementType) {
	animPref = movementType;
	switch(animPref) {
	case TIMELINE:
		timeline = new Timeline();
		timeline.setCycleCount(Animation.INDEFINITE);
		break;
	case TIMER:
		timer = new AnimationTimer() {
			@Override
			public void handle(long l) {
				update();
			}
		};
		break;
	case TRANSITION:
		transition = new Transition() {
			{
				setCycleDuration(Duration.seconds(1));
			}

			@Override
			protected void interpolate(double frac) {
				updateTransition(frac);
			}
		};
		transition.setCycleCount(Animation.INDEFINITE);
		break;
	case ANIMATION:
		break;
	}

}
 
开发者ID:sanke69,项目名称:fr.xs.jtk,代码行数:34,代码来源:AnimatedCameraController.java

示例4: CameraController

import javafx.animation.Transition; //导入方法依赖的package包/类
public CameraController(boolean enableTransforms, AnimationPreference movementType) {
    enable = enableTransforms;
    animPref = movementType;
    switch (animPref) {
        case TIMELINE:
            timeline = new Timeline();
            timeline.setCycleCount(Animation.INDEFINITE);
            break;
        case TIMER:
            timer = new AnimationTimer() {
                @Override
                public void handle(long l) {
                    if (enable) {
                        initialize();
                        enable = false;
                    }
                    update();
                }
            };
            break;
        case TRANSITION:
            transition = new Transition() {
                {setCycleDuration(Duration.seconds(1));}
                @Override
                protected void interpolate(double frac) {
                    updateTransition(frac);
                }
            };
            transition.setCycleCount(Animation.INDEFINITE);
            break;
        case ANIMATION:
            
            break;
    }

}
 
开发者ID:FXyz,项目名称:FXyzLib,代码行数:37,代码来源:CameraController.java

示例5: fazerTransicao

import javafx.animation.Transition; //导入方法依赖的package包/类
public static Transition fazerTransicao(Transicoes transicao, double duracaoSegundos, Node alvo) {
	Duration duracao = new Duration(duracaoSegundos * 1000);
	Transition t = null;

	switch (transicao) {
	case FADE:
		FadeTransition fadeTransition = new FadeTransition();
		fadeTransition.setFromValue(1);
		fadeTransition.setToValue(0);
		fadeTransition.setDuration(duracao);
		fadeTransition.setNode(alvo);
		t = fadeTransition;
		break;
	case FILL:
		FillTransition fillTransition = new FillTransition();
		fillTransition.setFromValue(Color.RED);
		fillTransition.setToValue(Color.DARKGREEN);
		fillTransition.setDuration(duracao);
		fillTransition.setShape((Shape) alvo);
		t = fillTransition;
		break;
	case ROTATE:
		RotateTransition rotateTransition = new RotateTransition();
		rotateTransition.setByAngle(360);
		rotateTransition.setDuration(duracao);
		rotateTransition.setNode(alvo);
		t = rotateTransition;
		break;
	case SCALE:
		ScaleTransition scaleTransition = new ScaleTransition();
		scaleTransition.setFromX(1);
		scaleTransition.setFromY(1);
		scaleTransition.setToX(4);
		scaleTransition.setToY(4);
		scaleTransition.setDuration(duracao);
		scaleTransition.setNode(alvo);
		t = scaleTransition;
		break;
	case TRANSLATE:
		TranslateTransition translateTransition = new TranslateTransition();
		translateTransition.setToX(600);
		translateTransition.setToY(250);
		translateTransition.setDuration(duracao);
		translateTransition.setNode(alvo);
		t = translateTransition;
		break;
	default:
		break;
	}
	t.setAutoReverse(true);
	t.setCycleCount(2);
	return t;
}
 
开发者ID:jesuino,项目名称:livro-javafx-pratico,代码行数:54,代码来源:AprendendoTransicoes.java


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