本文整理匯總了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);
}
示例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;
}