當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。