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