Java Code Examples for javafx.animation.ParallelTransition#setCycleCount()

The following examples show how to use javafx.animation.ParallelTransition#setCycleCount() . 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: MainController.java    From green_android with GNU General Public License v3.0 5 votes vote down vote up
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
 
Example 2
Source File: MainController.java    From GreenBits with GNU General Public License v3.0 5 votes vote down vote up
public void readyToGoAnimation() {
    // Buttons slide in and clickable address appears simultaneously.
    TranslateTransition arrive = new TranslateTransition(Duration.millis(1200), controlsBox);
    arrive.setInterpolator(new ElasticInterpolator(EasingMode.EASE_OUT, 1, 2));
    arrive.setToY(0.0);
    FadeTransition reveal = new FadeTransition(Duration.millis(1200), addressControl);
    reveal.setToValue(1.0);
    ParallelTransition group = new ParallelTransition(arrive, reveal);
    group.setDelay(NotificationBarPane.ANIM_OUT_DURATION);
    group.setCycleCount(1);
    group.play();
}
 
Example 3
Source File: BackgroundController.java    From examples-javafx-repos1 with Apache License 2.0 5 votes vote down vote up
@FXML
public void initialize() {
	
	TranslateTransition translateTransition =
            new TranslateTransition(Duration.millis(10000), background1);
	translateTransition.setFromX(0);
	translateTransition.setToX(-1 * BACKGROUND_WIDTH);
	translateTransition.setInterpolator(Interpolator.LINEAR);

	TranslateTransition translateTransition2 =
           new TranslateTransition(Duration.millis(10000), background2);
	translateTransition2.setFromX(0);
	translateTransition2.setToX(-1 * BACKGROUND_WIDTH);
	translateTransition2.setInterpolator(Interpolator.LINEAR);

	parallelTransition = 
		new ParallelTransition( translateTransition, translateTransition2 );
	parallelTransition.setCycleCount(Animation.INDEFINITE);

	//
	// Sets the label of the Button based on the animation state
	//
	parallelTransition.statusProperty().addListener((obs, oldValue, newValue) -> {
		if( newValue == Animation.Status.RUNNING ) {
			btnControl.setText( "||" );
		} else {
			btnControl.setText( ">" );
		}
	});
}
 
Example 4
Source File: ImprovedBackgroundController.java    From examples-javafx-repos1 with Apache License 2.0 4 votes vote down vote up
@FXML
public void initialize() {
	
	TranslateTransition background1Transition =
            new TranslateTransition(Duration.millis(8000), background1);
	background1Transition.setFromX(0);
	background1Transition.setToX(-1 * BACKGROUND_WIDTH);
	background1Transition.setInterpolator(Interpolator.LINEAR);

	TranslateTransition background2Transition =
           new TranslateTransition(Duration.millis(8000), background2);
	background2Transition.setFromX(0);
	background2Transition.setToX(-1 * BACKGROUND_WIDTH);
	background2Transition.setInterpolator(Interpolator.LINEAR);

	ParallelTransition backgroundWrapper = new ParallelTransition(
			background1Transition, background2Transition
			);
	backgroundWrapper.setCycleCount(Animation.INDEFINITE);
	
	TranslateTransition clouds1Transition =
            new TranslateTransition(Duration.millis(20000), clouds1);
	clouds1Transition.setFromX(0);
	clouds1Transition.setToX(-1 * BACKGROUND_WIDTH);
	clouds1Transition.setInterpolator(Interpolator.LINEAR);

	TranslateTransition clouds2Transition =
           new TranslateTransition(Duration.millis(20000), clouds2);
	clouds2Transition.setFromX(0);
	clouds2Transition.setToX(-1 * BACKGROUND_WIDTH);
	clouds2Transition.setInterpolator(Interpolator.LINEAR);

	ParallelTransition cloudsWrapper = new ParallelTransition(
			clouds1Transition, clouds2Transition
			);
	cloudsWrapper.setCycleCount(Animation.INDEFINITE);
	
	parallelTransition = 
		new ParallelTransition( backgroundWrapper,
								cloudsWrapper );

	parallelTransition.setCycleCount(Animation.INDEFINITE);

	//
	// Sets the label of the Button based on the animation state
	//
	parallelTransition.statusProperty().addListener((obs, oldValue, newValue) -> {
		if( newValue == Animation.Status.RUNNING ) {
			btnControl.setText( "||" );
		} else {
			btnControl.setText( ">" );
		}
	});
}