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


Java FadeTransition類代碼示例

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


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

示例1: ActionTextPane

import javafx.animation.FadeTransition; //導入依賴的package包/類
public ActionTextPane() {

        actionText = new Label("Test");
        graphic = new ImageView(new Image("assets/icons/editor_action_info_icon.png"));
        actionText.setGraphic(graphic);
        actionText.setTextFill(Utils.getDefaultTextColor());
        actionText.setAlignment(Pos.CENTER);
        actionText.setPadding(new Insets(0, 0, 0, 5));
        getChildren().add(actionText);
        setAlignment(Pos.CENTER);

        ft = new FadeTransition(Duration.millis(500), graphic);
        ft.setFromValue(1.0);
        ft.setToValue(0.0);
        ft.setAutoReverse(true);
        ft.setCycleCount(4);

    }
 
開發者ID:jdesive,項目名稱:textmd,代碼行數:19,代碼來源:ActionTextPane.java

示例2: 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

示例3: 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

示例4: showSplash

import javafx.animation.FadeTransition; //導入依賴的package包/類
private void showSplash(final Stage initStage, Task<?> task, InitCompletionHandler initCompletionHandler) {
    progressText.textProperty().bind(task.messageProperty());
    loadProgress.progressProperty().bind(task.progressProperty());
    task.stateProperty().addListener((observableValue, oldState, newState) -> {
        if (newState == Worker.State.SUCCEEDED) {
            loadProgress.progressProperty().unbind();
            loadProgress.setProgress(1);
            initStage.toFront();
            FadeTransition fadeSplash = new FadeTransition(Duration.seconds(1.2), splashLayout);
            fadeSplash.setFromValue(1.0);
            fadeSplash.setToValue(0.0);
            fadeSplash.setOnFinished(actionEvent -> initStage.hide());
            fadeSplash.play();

            initCompletionHandler.complete();
        }
    });

    Scene splashScene = new Scene(splashLayout);
    initStage.initStyle(StageStyle.UNDECORATED);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();
    initStage.setScene(splashScene);
    initStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - SPLASH_WIDTH / 2);
    initStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - SPLASH_HEIGHT / 2);
    initStage.show();
}
 
開發者ID:mhusam,項目名稱:ChessBot,代碼行數:27,代碼來源:ChessBotAppSplash.java

示例5: onActionSimulateGameMode

import javafx.animation.FadeTransition; //導入依賴的package包/類
private void onActionSimulateGameMode(EGameMode gameMode) {
    DebugConsole.getDefault().debug(this.getClass(), "On Action simulate GameMode: " + gameMode.toString()); // NOI18N

    final SequentialTransition st = new SequentialTransition();
    st.setDelay(Duration.millis(125.0d));
    
    final PauseTransition ptStopGameMode = this.onActionStopGameMode();
    st.getChildren().add(ptStopGameMode);
    
    final FadeTransition ftHideGameInformations = this.onActionHideGameInformations();
    st.getChildren().add(ftHideGameInformations);
    
    final FadeTransition ftShowGameInformations = this.onActionShowGameInformations(gameMode);
    st.getChildren().add(ftShowGameInformations);
    
    final PauseTransition ptStartGameMode = this.onActionStartGameMode(gameMode);
    st.getChildren().add(ptStartGameMode);
    
    st.playFromStart();
}
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:21,代碼來源:GameEngine.java

示例6: start

import javafx.animation.FadeTransition; //導入依賴的package包/類
@Override
public void start(Stage primaryStage) {
    if (primaryStage == null) {
        return;
    }

  Group group = new Group();
  Rectangle rect = new Rectangle(20,20,200,200);

  FadeTransition ft = new FadeTransition(Duration.millis(5000), rect);
  ft.setFromValue(1.0);
  ft.setToValue(0.0);
  ft.play();

  group.getChildren().add(rect);

  Scene scene = new Scene(group, 300, 200);
  primaryStage.setScene(scene);
  primaryStage.show();
}
 
開發者ID:lttng,項目名稱:lttng-scope,代碼行數:21,代碼來源:FadeTransitionEx.java

示例7: dataItemAdded

import javafx.animation.FadeTransition; //導入依賴的package包/類
@Override protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) {
    Node candle = createCandle(getData().indexOf(series), item, itemIndex);
    if (shouldAnimate()) {
        candle.setOpacity(0);
        getPlotChildren().add(candle);
        // fade in new candle
        FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
        ft.setToValue(1);
        ft.play();
    } else {
        getPlotChildren().add(candle);
    }
    // always draw average line on top
    if (series.getNode() != null) {
        series.getNode().toFront();
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:18,代碼來源:AdvCandleStickChartSample.java

示例8: seriesAdded

import javafx.animation.FadeTransition; //導入依賴的package包/類
@Override protected void seriesAdded(Series<Number, Number> series, int seriesIndex) {
    // handle any data already in series
    for (int j = 0; j < series.getData().size(); j++) {
        Data item = series.getData().get(j);
        Node candle = createCandle(seriesIndex, item, j);
        if (shouldAnimate()) {
            candle.setOpacity(0);
            getPlotChildren().add(candle);
            // fade in new candle
            FadeTransition ft = new FadeTransition(Duration.millis(500), candle);
            ft.setToValue(1);
            ft.play();
        } else {
            getPlotChildren().add(candle);
        }
    }
    // create series path
    Path seriesPath = new Path();
    seriesPath.getStyleClass().setAll("candlestick-average-line", "series" + seriesIndex);
    series.setNode(seriesPath);
    getPlotChildren().add(seriesPath);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:23,代碼來源:AdvCandleStickChartSample.java

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: setPlusScoreAnimation

import javafx.animation.FadeTransition; //導入依賴的package包/類
/**
 * Animates a label with the plus(new additional value) text.
 * @param plus 
 */
private void setPlusScoreAnimation(String plus) {
	if(plus.length() > 2 ) {
		double width = 25 * plus.length();
		PLUS_SCORE.setMinSize(width, 45);
	}
	PLUS_SCORE.setText("+" + plus);
	this.setScoreStyle();
	PLUS_SCORE.setTextFill(Color.WHITE);
	FadeTransition ft = new FadeTransition(Duration.seconds(.7), PLUS_SCORE);
	ft.setFromValue(1);
	ft.setToValue(0);
	ft.play();
	
	TranslateTransition tt = new TranslateTransition(Duration.seconds(.7), PLUS_SCORE);
	tt.setFromX(55);
	tt.setFromY(-50);
	tt.setToY(50);
	tt.play();
}
 
開發者ID:ShekkarRaee,項目名稱:xpanderfx,代碼行數:24,代碼來源:MainFXMLDocumentController.java


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