本文整理匯總了Java中javafx.animation.FadeTransition.playFromStart方法的典型用法代碼示例。如果您正苦於以下問題:Java FadeTransition.playFromStart方法的具體用法?Java FadeTransition.playFromStart怎麽用?Java FadeTransition.playFromStart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.animation.FadeTransition
的用法示例。
在下文中一共展示了FadeTransition.playFromStart方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onActionNextRandomMap
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void onActionNextRandomMap() {
LoggerFacade.INSTANCE.debug(this.getClass(), "On action next random Map"); // NOI18N
final int randomMapIndex = MapFacade.INSTANCE.getRandomMapIndex();
final MapModel mm = MapFacade.INSTANCE.loadMap(randomMapIndex);
this.printMapToConsole(mm);
vbRandomMap.getChildren().clear();
vbRandomMap.setOpacity(0.0d);
vbRandomMap.getChildren().add(this.getLabel("Map: " + randomMapIndex)); // NOI18N
vbRandomMap.getChildren().add(this.getLabel("")); // NOI18N
final ObservableList<String> map = mm.getMapAsStrings();
map.stream().forEach(line -> {
vbRandomMap.getChildren().add(this.getLabel(line));
});
final FadeTransition ftShowNextRandomMap = new FadeTransition();
ftShowNextRandomMap.setDuration(Duration.millis(550.0d));
ftShowNextRandomMap.setFromValue(0.0d);
ftShowNextRandomMap.setToValue(1.0d);
ftShowNextRandomMap.setNode(vbRandomMap);
ftShowNextRandomMap.playFromStart();
}
示例2: showViewPreview
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void showViewPreview() {
LoggerFacade.INSTANCE.debug(this.getClass(), "Show view Preview"); // NOI18N
final PreviewView view = new PreviewView();
final PreviewPresenter presenter = view.getRealPresenter();
presenter.registerActions();
final Parent preview = view.getView();
preview.setOpacity(0.0d);
bpGameArea.setCenter(preview);
final FadeTransition ftHidePreviewView = new FadeTransition();
ftHidePreviewView.setDelay(Duration.millis(250.0d));
ftHidePreviewView.setDuration(Duration.millis(375.0d));
ftHidePreviewView.setFromValue(0.0d);
ftHidePreviewView.setToValue(1.0d);
ftHidePreviewView.setNode(preview);
ftHidePreviewView.playFromStart();
}
示例3: onActionHideMap
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void onActionHideMap() {
final FadeTransition ftHideMap = new FadeTransition();
ftHideMap.setDuration(Duration.millis(375.0d));
ftHideMap.setFromValue(1.0d);
ftHideMap.setToValue(0.0d);
ftHideMap.setNode(vbRandomMap);
ftHideMap.setOnFinished((ActionEvent event) -> {
this.onActionNextRandomMap();
this.initializeShowNextRandomMap();
});
ftHideMap.playFromStart();
}
示例4: toast
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
public static void toast(final Label label, final String message) {
label.setText(message);
FadeTransition trans = new FadeTransition();
trans.setDuration(Duration.seconds(3));
trans.setFromValue(0);
trans.setToValue(1);
trans.setNode(label);
trans.playFromStart();
trans.setOnFinished((e) -> {
label.setOpacity(0);
});
}
示例5: treeViewFinish
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void treeViewFinish() {
log.info("***treeViewFinish called");
// Sort the nodes off of root
treeItems = sortTreeNodes(treeItems);
updateOverlayTreeview(treeItems);
addPseudoClassToLeafs(overlayTreeView);
updateOverlayTreeViewRecentFolder(false);
// overlayNameLabel.setVisible(true);
overlayTreeProgressBar.setStyle("-fx-accent: forestgreen;");
progressBarLabel.setVisible(false);
FadeTransition fadeOut = new FadeTransition(Duration.millis(2000));
fadeOut.setNode(overlayTreeProgressBar);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.0);
fadeOut.setCycleCount(1);
fadeOut.setAutoReverse(false);
fadeOut.playFromStart();
FadeTransition fadeIn = new FadeTransition(Duration.millis(4000));
fadeIn.setNode(overlayNameLabel);
fadeIn.setFromValue(0.0);
fadeIn.setToValue(1.0);
fadeIn.setCycleCount(1);
fadeIn.setAutoReverse(false);
fadeIn.playFromStart();
}
示例6: gotoPage
import javafx.animation.FadeTransition; //導入方法依賴的package包/類
private void gotoPage(String status) {
StackPane messagesroot = MessageUtils.getRoot(rootpane);
if (messagesroot != null) {
// If it is not already added to the scene, there is no need to dispose dialogs.
MessageUtils.disposeAllDialogs(messagesroot);
}
UnitPage unitpage = unitpages.get(status);
if (unitpage == null) {
unitpage = unitpages.get("notfound");
}
// clean everything
container.getChildren().clear();
FadeTransition s2 = new FadeTransition(Duration.millis(200), container);
s2.setInterpolator(Interpolator.EASE_IN);
s2.setFromValue(0.3);
s2.setToValue(1.0);
s2.playFromStart();
// Initialize grid
container.setMaxSize(unitpage.getMaxWidth(), unitpage.getMaxHeight());
for (UnitLine line : unitpage.getUnitLines()) {
container.getChildren().add(line.getNode());
}
headertitle.setText(unitpage.getText());
// Set label if empty
if (container.getChildren().isEmpty()) {
container.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
Label l = new Label();
l.setText(unitpage.getEmptyLabel());
l.setAlignment(Pos.CENTER);
l.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
l.getStyleClass().add("emptypanel");
VBox.setVgrow(l, Priority.SOMETIMES);
container.getChildren().add(l);
}
// Modify panel if system
if (menubutton != null) {
menubutton.setDisable(unitpage.isSystem());
}
animateListPages(-1.0);
}