本文整理匯總了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);
}
}
示例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);
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}