Java Code Examples for javafx.animation.RotateTransition#setAxis()

The following examples show how to use javafx.animation.RotateTransition#setAxis() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FXMLController.java    From JavaFX-Tutorial-Codes with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes the controller class.
 */
@Override
public void initialize(URL url, ResourceBundle rb) {
    RotateTransition transition = new RotateTransition(Duration.seconds(5), arc1);
    transition.setAxis(new Point3D(50, 50, 0));
    transition.setByAngle(200);
    transition.play();
}
 
Example 2
Source File: SpinningGlobe.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
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();
}
 
Example 3
Source File: MarsViewer.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
private RotateTransition rotateAroundYAxis(Node node) {
	RotateTransition rotate = new RotateTransition(
			Duration.seconds(ROTATE_SECS),
			node
			);
    rotate.setAxis(Rotate.Y_AXIS);
    rotate.setFromAngle(360);
    rotate.setToAngle(0);
    rotate.setInterpolator(Interpolator.LINEAR);
    rotate.setCycleCount(RotateTransition.INDEFINITE);

    return rotate;
}
 
Example 4
Source File: HangmanMain.java    From FXTutorials with MIT License 5 votes vote down vote up
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();
}