本文整理汇总了Java中javafx.animation.RotateTransition.play方法的典型用法代码示例。如果您正苦于以下问题:Java RotateTransition.play方法的具体用法?Java RotateTransition.play怎么用?Java RotateTransition.play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.animation.RotateTransition
的用法示例。
在下文中一共展示了RotateTransition.play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: switchStateAnimation
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void switchStateAnimation(TDDState newState){
RotateTransition rotateTransition = new RotateTransition(Duration.millis(800), cycleImage);
rotateTransition.setFromAngle(0);
rotateTransition.setToAngle(-180);
FadeTransition ft = new FadeTransition(Duration.millis(800), cycleImage);
ft.setFromValue(1);
ft.setToValue(0);
RotateTransition rotateTransition2 = new RotateTransition(Duration.millis(800), cycleImageOverlay);
rotateTransition2.setFromAngle(180);
rotateTransition2.setToAngle(0);
Image newImg = getImageOfPhase(newState);
rotateTransition2.setOnFinished(event -> {
cycleImage.setImage(newImg);
});
FadeTransition ft2 = new FadeTransition(Duration.millis(800), cycleImageOverlay);
ft2.setFromValue(0);
ft2.setToValue(1);
ft.play();
cycleImageOverlay.setImage(newImg);
rotateTransition.play();
ft.play();
ft2.play();
rotateTransition2.play();
}
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-amigos,代码行数:27,代码来源:ExerciseController.java
示例2: TestLoadingScene
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public TestLoadingScene() {
getText().setFont(Font.font("Segoe UI", 24));
getText().setTranslateY(50);
Circle circle = new Circle(50, 50, 50);
Shape shape = Shape.subtract(new Rectangle(100, 100), circle);
shape.setFill(Color.BLUE);
shape.setStroke(Color.YELLOW);
RotateTransition rt = new RotateTransition(Duration.seconds(2), shape);
rt.setByAngle(360);
rt.setCycleCount(15);
rt.play();
shape.setTranslateX(700);
shape.setTranslateY(500);
getContentRoot().getChildren().set(1, shape);
}
示例3: moveToDeck
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
/**
* Method to display the movement of a card to a Deck
* @param card the card to move
*/
private PathTransition moveToDeck(Card card) {
StackPane deck = ownerToDeck(card.getOwner());
Path path = new Path(new MoveTo(card.localToParent(0,0).getX() + card.getWidth()/2, card.localToParent(0,0).getY() + card.getHeight()/2),
new LineTo(deck.localToParent(deck.getWidth()/2.,deck.getHeight()/2.).getX(), deck.localToParent(deck.getWidth()/2.,deck.getHeight()/2.).getY()));
boolean horizontal = card.getOwner() == Owner.PROJECT_DECK || card.getOwner() == Owner.PROJECT_DISCARD;
card.toFront();
if (horizontal) {
RotateTransition rotateTransition = new RotateTransition(Duration.millis(500), card);
rotateTransition.setByAngle(-90);
rotateTransition.play();
}
ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(500), card);
scaleTransition.setToX(horizontal ? deck.getScaleY() : deck.getScaleX());
scaleTransition.setToY(horizontal ? deck.getScaleX() : deck.getScaleY());
scaleTransition.play();
card.setClickable(false, view);
return new PathTransition(Duration.seconds(.5),path,card);
}
示例4: close
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void close() {
if (State.CLOSED == getState()) return;
setState(State.CLOSED);
RotateTransition rotate = new RotateTransition();
rotate.setNode(cross);
rotate.setToAngle(0);
rotate.setDuration(Duration.millis(200));
rotate.setInterpolator(Interpolator.EASE_BOTH);
rotate.play();
closeTimeLines[closeTimeLines.length - 1].setOnFinished(actionEvent -> {
FadeTransition buttonFadeOut = new FadeTransition();
buttonFadeOut.setNode(mainMenuButton);
buttonFadeOut.setDuration(Duration.millis(100));
buttonFadeOut.setToValue(options.getButtonAlpha());
buttonFadeOut.play();
buttonFadeOut.setOnFinished(event -> {
if (options.isButtonHideOnClose()) hide();
fireMenuEvent(new MenuEvent(this, null, MenuEvent.MENU_CLOSE_FINISHED));
});
});
for (int i = 0 ; i < closeTimeLines.length ; i++) {
closeTimeLines[i].play();
}
fireMenuEvent(new MenuEvent(this, null, MenuEvent.MENU_CLOSE_STARTED));
}
示例5: LoadingCircle
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public LoadingCircle() {
Circle circle = new Circle(20);
circle.setFill(null);
circle.setStroke(Color.WHITE);
circle.setStrokeWidth(2);
Rectangle rect = new Rectangle(20, 20);
Shape shape = Shape.subtract(circle, rect);
shape.setFill(Color.WHITE);
getChildren().add(shape);
animation = new RotateTransition(Duration.seconds(2.5), this);
animation.setByAngle(-360);
animation.setInterpolator(Interpolator.LINEAR);
animation.setCycleCount(Animation.INDEFINITE);
animation.play();
}
示例6: flipTo180
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void flipTo180(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_0_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_0_90.setAxis(Rotate.Y_AXIS);
ROT_0_90.setFromAngle(0);
ROT_0_90.setToAngle(90);
ROT_0_90.play();
ROT_0_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_180 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_180.setAxis(Rotate.Y_AXIS);
ROT_90_180.setFromAngle(90);
ROT_90_180.setToAngle(180);
ROT_90_180.play();
}
});
}
示例7: flipTo0
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private void flipTo0(final Domino.Dot DOT, final String STYLE) {
final RotateTransition ROT_180_90 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_180_90.setAxis(Rotate.Y_AXIS);
ROT_180_90.setFromAngle(180);
ROT_180_90.setToAngle(90);
ROT_180_90.play();
ROT_180_90.setOnFinished(new EventHandler<ActionEvent>() {
@Override public void handle(final ActionEvent EVENT) {
dotMap.get(DOT).getStyleClass().clear();
dotMap.get(DOT).getStyleClass().add(STYLE);
final RotateTransition ROT_90_0 = new RotateTransition(FLIP_TIME.divide(2), dotMap.get(DOT));
ROT_90_0.setAxis(Rotate.Y_AXIS);
ROT_90_0.setFromAngle(90);
ROT_90_0.setToAngle(0);
ROT_90_0.play();
}
});
}
示例8: queueImageView
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
private ImageView queueImageView( final TileViewModel build ) {
final ImageView queuedIcon = new ImageView( UIUtils.createImage( "icons/queued.png" ) );
queuedIcon.setFitHeight( 45 );
queuedIcon.setPreserveRatio( true );
queuedIcon.visibleProperty( ).bind( build.queuedProperty( ) );
final RotateTransition transition = new RotateTransition( Duration.seconds( 3 ), queuedIcon );
transition.setByAngle( 360 );
transition.setCycleCount( Timeline.INDEFINITE );
transition.play( );
return queuedIcon;
}
示例9: notifyCloseAction
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
void notifyCloseAction() {
if (isMenuOpen) {
isMenuOpen = false;
RotateTransition rotate = new RotateTransition(Duration.seconds(0.2), menuButton.getGraphic());
rotate.setToAngle(0);
rotate.play();
hideAction.run();
}
}
示例10: notifyOpenAction
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
void notifyOpenAction() {
RotateTransition rotate = new RotateTransition(Duration.seconds(0.2), menuButton.getGraphic());
rotate.setToAngle(90);
rotate.play();
openAction.run();
}
示例11: rotateGlobe
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void rotateGlobe() {
rt = new RotateTransition(Duration.seconds(OrbitInfo.SOLAR_DAY/500D), globe.getWorld());
//rt.setByAngle(360);
rt.setInterpolator(Interpolator.LINEAR);
rt.setCycleCount(Animation.INDEFINITE);
rt.setAxis(Rotate.Y_AXIS);
rt.setFromAngle(360);
rt.setToAngle(0);
rt.play();
}
示例12: flip
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
/**
* Flips the given {@link Node} in the given direction until it is turned
* roughly 90 degrees, read it is not visible anymore. Then the first
* {@link Runnable} {@code pOnTippingPoint} will be executed which allows to
* swap the content or properties of the {@link Node} without the user
* seeing it. After that the rotation will continue back into its starting
* position, where {@code pOnFinished} will be called.
* <p>
* If there is a {@link PerspectiveCamera} is set on the {@link Scene}, this
* function will already choose the correct angle needed for the tipping
* point so that the user will not see the swap of the content.
*
* @param pNode the {@link Node} to rotate.
* @param pOrientation the {@link Orientation} in which to rotate. Note that
* {@link Orientation#HORIZONTAL} means from right to left.
* @param pRightLeftTopDown {@code true} if the animation should be from
* right to left/top to down. {@code false} if it should be left
* to right/bottom to up.
* @param pOnTippingPoint the {@link Runnable} to execute when the
* {@link Node} is exactly edge on with the viewer. Can be
* {@code null}.
* @param pOnFinished the {@link Runnable} to execute when the rotation has
* finished. Can be {@code null}.
*/
public static void flip(Node pNode, Orientation pOrientation, boolean pRightLeftTopDown, Runnable pOnTippingPoint, Runnable pOnFinished)
{
double tippingPoint = calculateEdgeAngle(pNode, pOrientation);
RotateTransition startTransition = createFlipStartTransition(pNode, pOrientation, pRightLeftTopDown);
RotateTransition endTransition = createFlipEndTransition(pNode, pOrientation, pRightLeftTopDown);
startTransition.setOnFinished(pActionEvent ->
{
if (pOnTippingPoint != null)
{
pOnTippingPoint.run();
}
pNode.setRotate(tippingPoint + 180);
endTransition.play();
});
if (pOnFinished != null)
{
endTransition.setOnFinished(pActionEvent -> pOnFinished.run());
}
startTransition.play();
}
示例13: roll
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void roll() {
RotateTransition rt = new RotateTransition(Duration.seconds(1), this);
rt.setFromAngle(0);
rt.setToAngle(360);
rt.setOnFinished(event -> {
valueProperty.set((int)(Math.random() * (MAX_VALUE - MIN_VALUE + 1)) + MIN_VALUE);
});
rt.play();
}
示例14: show
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
public void show() {
RotateTransition rt = new RotateTransition(Duration.seconds(1), bg);
rt.setAxis(Rotate.Y_AXIS);
rt.setToAngle(180);
rt.setOnFinished(event -> text.setVisible(true));
rt.play();
}
示例15: start
import javafx.animation.RotateTransition; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
StackPane root = new StackPane();
Node clockDial = createClockDial();
Node hourHand = createHourHand();
Node minuteHand = createMinuteHand();
Node secondHand = createSecondHand();
Node centerPoint = createCenter();
root.getChildren().addAll(
clockDial, hourHand, minuteHand, secondHand, centerPoint
);
LocalTime time = LocalTime.now();
RotateTransition secondsTransition = createRotateTransition(Duration.seconds(60), secondHand, getSecondsAngle(time));
secondsTransition.play();
RotateTransition minuteTransition = createRotateTransition(Duration.minutes(60), minuteHand, getMinuteAgnel(time));
minuteTransition.play();
RotateTransition hourTransition = createRotateTransition(Duration.hours(12), hourHand, getHourAngle(time));
hourTransition.play();
Scene scene = new Scene(root);
primaryStage.setTitle("Clock");
primaryStage.setScene(scene);
primaryStage.show();
}