當前位置: 首頁>>代碼示例>>Java>>正文


Java FadeTransition.setOnFinished方法代碼示例

本文整理匯總了Java中javafx.animation.FadeTransition.setOnFinished方法的典型用法代碼示例。如果您正苦於以下問題:Java FadeTransition.setOnFinished方法的具體用法?Java FadeTransition.setOnFinished怎麽用?Java FadeTransition.setOnFinished使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.animation.FadeTransition的用法示例。


在下文中一共展示了FadeTransition.setOnFinished方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dataItemRemoved

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
@Override protected void dataItemRemoved(Data<Number, Number> item, Series<Number, Number> series) {
    final Node candle = item.getNode();
    if (shouldAnimate()) {
        // fade out old candle
        FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
        ft.setToValue(0);
        ft.setOnFinished(new EventHandler<ActionEvent>() {

            @Override
            public void handle(ActionEvent actionEvent) {
                getPlotChildren().remove(candle);
            }
        });
        ft.play();
    } else {
        getPlotChildren().remove(candle);
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:AdvCandleStickChartSample.java

示例2: seriesRemoved

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
@Override protected void seriesRemoved(Series<Number, Number> series) {
    // remove all candle nodes
    for (XYChart.Data<Number, Number> d : series.getData()) {
        final Node candle = d.getNode();
        if (shouldAnimate()) {
            // fade out old candle
            FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
            ft.setToValue(0);
            ft.setOnFinished(new EventHandler<ActionEvent>() {

                @Override
                public void handle(ActionEvent actionEvent) {
                    getPlotChildren().remove(candle);
                }
            });
            ft.play();
        } else {
            getPlotChildren().remove(candle);
        }
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:22,代碼來源:AdvCandleStickChartSample.java

示例3: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
 * Método de efeito de transição de saída     
 */ 
private void makeFadeOut(String path) {
    FadeTransition fadeTransition = new FadeTransition();
    fadeTransition.setDuration(Duration.millis(250));
    fadeTransition.setNode(rootPane);
    fadeTransition.setFromValue(1);
    fadeTransition.setToValue(0);
    fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            try {
                loadScreenPlay(path);
            } catch (IOException ex) {
                Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    });
    fadeTransition.play();
}
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:22,代碼來源:ControllerLayoutNome.java

示例4: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
 * Método que inicia a view Inicial (MENU) e aplica estilos CSS nos botões	 
 */
@Autor("Divino Matheus")
   private void makeFadeOut(String path) {
       	
	FadeTransition fadeTransition = new FadeTransition();
	fadeTransition.setDuration(Duration.millis(250));
	fadeTransition.setNode(rootPane);
	fadeTransition.setFromValue(1);
	fadeTransition.setToValue(0);
	fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
			
		@Override
		public void handle(ActionEvent event) {
			try {
				loadScreenPlay(path);
			} catch (IOException ex) {
				Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
			}
		}
	});		
	fadeTransition.play();
}
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:25,代碼來源:ControllerLayoutPrincipal.java

示例5: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void makeFadeOut(String path) {
    FadeTransition fadeTransition = new FadeTransition();
    fadeTransition.setDuration(Duration.millis(250));
    fadeTransition.setNode(rootPane);
    fadeTransition.setFromValue(1);
    fadeTransition.setToValue(0);
    fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            try {
                loadScreenPlay(path);
            } catch (IOException ex) {
                Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    });
    fadeTransition.play();
}
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:19,代碼來源:ControllerLayoutCMPergunta.java

示例6: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**	 
 * Método para efeito de transição de saída	 
 */ 
private void makeFadeOut(String path) {
	FadeTransition fadeTransition = new FadeTransition();
	fadeTransition.setDuration(Duration.millis(250));
	fadeTransition.setNode(rootPane);
	fadeTransition.setFromValue(1);
	fadeTransition.setToValue(0);
	fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
		
		@Override
		public void handle(ActionEvent event) {
			try {
				loadScreenPlay(path);
			} catch (IOException ex) {
				Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
			}
		}
	});		
	fadeTransition.play();
}
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:23,代碼來源:ControllerLayoutInicial.java

示例7: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void makeFadeOut(String path) {
    FadeTransition fadeTransition = new FadeTransition();
    fadeTransition.setDuration(Duration.millis(250));
    fadeTransition.setNode(rootPane);
    fadeTransition.setFromValue(1);
    fadeTransition.setToValue(0);
    fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
    	
        @Override
        public void handle(ActionEvent event) {
            try {
                loadScreenPlay(path);
            } catch (IOException ex) {
                Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    });
    fadeTransition.play();
}
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:20,代碼來源:ControllerLayoutRanking.java

示例8: makeFadeOut

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**	 
* Método para efeito de transição de saída	 
*/ 
  private void makeFadeOut(String path) {
FadeTransition fadeTransition = new FadeTransition();
fadeTransition.setDuration(Duration.millis(250));
fadeTransition.setNode(rootPane);
fadeTransition.setFromValue(1);
fadeTransition.setToValue(0);
fadeTransition.setOnFinished(new EventHandler<ActionEvent>() {
	
	@Override
	public void handle(ActionEvent event) {
		try {
			loadScreenPlay(path);
		} catch (IOException ex) {
			Logger.getLogger(ControllerLayoutInicial.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
});		
fadeTransition.play();
  }
 
開發者ID:tadeuespindolapalermo,項目名稱:ShowMilhaoPOOJava,代碼行數:23,代碼來源:ControllerLayoutTelaRegras.java

示例9: handleStateChangeNotification

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
@Override
public void handleStateChangeNotification(StateChangeNotification evt) {
    if (evt.getType() == StateChangeNotification.Type.BEFORE_START) {
        if (stage.isShowing()) {
            // fade out, hide stage at the end of animation
            final FadeTransition fadeTransition =
                    new FadeTransition(
                            Duration.millis(1000), stage.getScene().getRoot());
            fadeTransition.setFromValue(1.0);
            fadeTransition.setToValue(0.0);
            final EventHandler<ActionEvent> eventHandler = t -> stage.hide();
            fadeTransition.setOnFinished(eventHandler);
            fadeTransition.play();
        } else {
            stage.hide();
        }
    }
}
 
開發者ID:AntonioGabrielAndrade,項目名稱:LIRE-Lab,代碼行數:19,代碼來源:SplashScreenPreloader.java

示例10: dataItemRemoved

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/** @inheritDoc */
@Override
protected void dataItemRemoved(final Data<X, Y> item, final MultiAxisChart.Series<X, Y> series) {
	final Node symbol = item.getNode();

	if (symbol != null) {
		symbol.focusTraversableProperty().unbind();
	}

	if (shouldAnimate()) {
		// fade out old symbol
		FadeTransition ft = new FadeTransition(Duration.millis(500), symbol);
		ft.setToValue(0);
		ft.setOnFinished(actionEvent -> {
			getPlotChildren().remove(symbol);
			removeDataItemFromDisplay(series, item);
			symbol.setOpacity(1.0);
		});
		ft.play();
	} else {
		getPlotChildren().remove(symbol);
		removeDataItemFromDisplay(series, item);
	}
}
 
開發者ID:JKostikiadis,項目名稱:MultiAxisCharts,代碼行數:25,代碼來源:MultiAxisScatterChart.java

示例11: deleteSection

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
@Override
public void deleteSection(int sectionId) {
	for(SectionView section : this.sections) {
		if(section.gameId == sectionId) {
			FadeTransition fadeTransition = new FadeTransition(Duration.seconds(7), section);
			fadeTransition.setFromValue(0.6);
			fadeTransition.setToValue(0);
			fadeTransition.play();
			fadeTransition.setOnFinished(event -> {
				ConcreteLineView.this.getChildren().remove(section);
				fadeTransition.setNode(null);
			});
			this.sections.remove(section);
			break;
		}
	}
}
 
開發者ID:TiWinDeTea,項目名稱:MagicMetro,代碼行數:18,代碼來源:ConcreteLineView.java

示例12: setScreen

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
/**
 * set a screen by string id
 * 
 * @param name
 */
public void setScreen(String name) {
    // dont try to set new screen
    if (screens.get(name) == null) {
        System.out.println("invalid screen");
        return;
    }
    
    // fade out animation
    if (screen != null) {
        FadeTransition ft = new FadeTransition(new Duration(500), screen.getScene().getRoot());
        ft.setFromValue(1);
        ft.setToValue(0);
        ft.play();
        
        ticking = false;
        
        ft.setOnFinished(e -> {
            fadeIn(name);
        });
    } else {
        fadeIn(name);
    }
}
 
開發者ID:GlassWispInteractive,項目名稱:fictional-spoon,代碼行數:29,代碼來源:ScreenControl.java

示例13: switchMenuTo

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
@Override
protected void switchMenuTo(Node menu) {
    Node oldMenu = menuRoot.getChildren().get(0);

    FadeTransition ft = new FadeTransition(Duration.seconds(0.33), oldMenu);
    ft.setToValue(0);
    ft.setOnFinished(e -> {
        menu.setOpacity(0);
        menuRoot.getChildren().set(0, menu);
        oldMenu.setOpacity(1);

        FadeTransition ft2 = new FadeTransition(Duration.seconds(0.33), menu);
        ft2.setToValue(1);
        ft2.play();
    });
    ft.play();
}
 
開發者ID:AlmasB,項目名稱:FXGL,代碼行數:18,代碼來源:FXGLDefaultMenu.java

示例14: flagAsError

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public void flagAsError() {
	
	this.normal.setVisible(true);  // hidden behind error
	this.highlight.setVisible(false);
	this.drag.setVisible(false);
	this.error.setVisible(true);
	
	FadeTransition ft = new FadeTransition(Duration.seconds(4), this.error);
    ft.setFromValue(1.0);
    ft.setToValue(0.0);
    ft.setOnFinished( (evt) -> {
    	
		this.normal.setVisible(true);  // show normal
		this.highlight.setVisible(false);
		this.drag.setVisible(false);
		this.error.setVisible(false);

    	this.error.setOpacity( 1.0d );  // restore opacity
    	
    });
    ft.play();
}
 
開發者ID:bekwam,項目名稱:examples-javafx-repos1,代碼行數:23,代碼來源:Sprite.java

示例15: CardPlayedToken

import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public CardPlayedToken(GameBoardView boardView, Card card) {
	Window parent = boardView.getScene().getWindow();
	this.cardToken = new CardTooltip();

	popup = new Popup();
	popup.getContent().setAll(cardToken);
	popup.setX(parent.getX() + 40);
	popup.show(parent);
	popup.setY(parent.getY() + parent.getHeight() * 0.5 - cardToken.getHeight() * 0.5);

	cardToken.setCard(card);

	NotificationProxy.sendNotification(GameNotification.ANIMATION_STARTED);
	FadeTransition animation = new FadeTransition(Duration.seconds(1.2), cardToken);
	animation.setDelay(Duration.seconds(0.6f));
	animation.setOnFinished(this::onComplete);
	animation.setFromValue(1);
	animation.setToValue(0);
	animation.play();
}
 
開發者ID:demilich1,項目名稱:metastone,代碼行數:21,代碼來源:CardPlayedToken.java


注:本文中的javafx.animation.FadeTransition.setOnFinished方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。