List of usage examples for javafx.animation RotateTransition RotateTransition
public RotateTransition(Duration duration, Node node)
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 200); stage.setScene(scene);// ww w . ja v a 2 s. c o m Rectangle rect = new Rectangle(100, 40, 100, 100); rect.setArcHeight(50); rect.setArcWidth(50); rect.setFill(Color.VIOLET); RotateTransition rt = new RotateTransition(Duration.millis(3000), rect); rt.setByAngle(180); rt.setAutoReverse(true); rt.play(); root.getChildren().add(rect); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene);// ww w .j a va2 s . com VBox vb = new VBox(); Rectangle rect = new Rectangle(100, 40, 100, 100); rect.setArcHeight(50); rect.setArcWidth(50); rect.setFill(Color.VIOLET); RotateTransition rt = new RotateTransition(Duration.millis(3000), rect); rt.setByAngle(180); rt.setAutoReverse(true); SequentialTransition seqTransition = new SequentialTransition(new PauseTransition(Duration.millis(1000)), // wait a second rt); seqTransition.play(); vb.getChildren().add(rect); scene.setRoot(vb); stage.show(); }
From source file:ijfx.ui.plugin.overlay.OverlayPanel.java
public void onGearClicked(MouseEvent e) { if (!optionsPane.isShowing()) { RotateTransition rotate = new RotateTransition(Duration.millis(500), gearIcon); rotate.setByAngle(180);//from w ww .j a v a2 s . c o m rotate.play(); optionsPane.show(gearIcon); } else { RotateTransition rotate = new RotateTransition(Duration.millis(500), gearIcon); rotate.setByAngle(-180); rotate.play(); optionsPane.hide(); } e.consume(); }
From source file:pe.edu.system.jcmr.controlador.SplashController.java
public void start() { FadeTransition tt = new FadeTransition(Duration.seconds(16), stackMain); // tt.setFromAngle(0); // tt.setToAngle(360); // tt.setAutoReverse(true); // tt.setCycleCount(4); // tt.setInterpolator(Interpolator.); // tt.setAxis( Rotate.X_AXIS ); tt.setAutoReverse(true);//from www . jav a 2 s . c o m tt.setCycleCount(3); tt.setFromValue(1.0); tt.setToValue(0.0); RotateTransition rr = new RotateTransition(Duration.seconds(30), imgLogo); rr.setCycleCount(3); rr.setByAngle(360); // rotator.setInterpolator(Interpolator.LINEAR); // tt.setFromX( -(imgLogo.getFitWidth()) ); // tt.setToX( stackMain.getPrefWidth() ); // tt.setCycleCount( Timeline.INDEFINITE ); // tt.play(); rr.play(); }
From source file:pe.edu.system.jcmr.controlador.SplashController.java
public void start2() { FadeTransition tt = new FadeTransition(Duration.seconds(16), stackMain); // tt.setFromAngle(0); // tt.setToAngle(360); // tt.setAutoReverse(true); // tt.setCycleCount(4); // tt.setInterpolator(Interpolator.); // tt.setAxis( Rotate.X_AXIS ); tt.setAutoReverse(true);//from ww w .j a v a 2 s .co m tt.setCycleCount(3); tt.setFromValue(1.0); tt.setToValue(0.0); RotateTransition rr = new RotateTransition(Duration.seconds(30), imgLogo2); rr.setCycleCount(3); rr.setByAngle(360); // rotator.setInterpolator(Interpolator.LINEAR); // tt.setFromX( -(imgLogo.getFitWidth()) ); // tt.setToX( stackMain.getPrefWidth() ); // tt.setCycleCount( Timeline.INDEFINITE ); // tt.play(); rr.play(); }
From source file:Watcher.FXMLDocumentController.java
@FXML protected void addSite(ActionEvent event) { addSitePane.setVisible(true);//from w ww. j a va 2 s. com RotateTransition rt = new RotateTransition(Duration.millis(200), addSitePane); rt.setFromAngle(180); rt.setToAngle(0); rt.setCycleCount(1); rt.setInterpolator(Interpolator.EASE_IN); fadeout(true); rt.play(); }
From source file:Watcher.FXMLDocumentController.java
@FXML protected void cancelSiteAdd(MouseEvent event) { RotateTransition rt = new RotateTransition(Duration.millis(200), addSitePane); rt.setFromAngle(0);//ww w.j a va 2 s.c om rt.setToAngle(180); rt.setCycleCount(1); rt.setInterpolator(Interpolator.EASE_OUT); rt.setOnFinished(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { addSitePane.setVisible(false); fadeout(false); } }); rt.play(); }