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


Java Transition.setAutoReverse方法代碼示例

本文整理匯總了Java中javafx.animation.Transition.setAutoReverse方法的典型用法代碼示例。如果您正苦於以下問題:Java Transition.setAutoReverse方法的具體用法?Java Transition.setAutoReverse怎麽用?Java Transition.setAutoReverse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.animation.Transition的用法示例。


在下文中一共展示了Transition.setAutoReverse方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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.setAutoReverse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。