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


Java ScaleTransition.setCycleCount方法代碼示例

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


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

示例1: lollipop

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
public static void lollipop(double x, double y) {
    Circle circle = new Circle(x, y, 2);
    circle.setFill(randomColor());
    FrameController.instance.hover.getChildren().add(circle);
    FadeTransition fadeTransition = new FadeTransition(Duration.millis(500), circle);
    fadeTransition.setAutoReverse(true);
    fadeTransition.setCycleCount(2);
    fadeTransition.setFromValue(0.0);
    fadeTransition.setToValue(1.0);
    ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(1000), circle);
    scaleTransition.setToX(10.0);
    scaleTransition.setToY(10.0);
    scaleTransition.setCycleCount(1);
    ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, scaleTransition);
    parallelTransition.play();
    executorService.schedule(() -> Platform.runLater(() ->
            FrameController.instance.hover.getChildren().remove(circle)), 1000, TimeUnit.MILLISECONDS);
}
 
開發者ID:IzzelAliz,項目名稱:LCL,代碼行數:19,代碼來源:Transition.java

示例2: doOutputScaleAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private void doOutputScaleAnimation(){
    ParallelTransition pt = new ParallelTransition();
    for(Node c : outputTabContainer.getChildren()){
        if(c == compilerArea) continue;
        ScaleTransition scale = new ScaleTransition(Duration.millis(250), c);
        scale.setFromX(1);
        scale.setToX(1.15);
        scale.setFromY(1);
        scale.setToY(1.15);
        scale.setAutoReverse(true);
        scale.setCycleCount(2);
        pt.getChildren().add(scale);
    }
    pt.play();

}
 
開發者ID:ProPra16,項目名稱:programmierpraktikum-abschlussprojekt-amigos,代碼行數:17,代碼來源:ExerciseController.java

示例3: emphasise

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
/**
 * Performs an animation to get the users attention
 *
 * @param sf
 *            the scale factor to enlarge the window by (1.0 => no scale)
 */
protected final void emphasise(double sf) {
	// Ignore if window is just being opened
	if (getScaleX() == 1 && getScaleY() == 1 && !isExtracted) {
		ScaleTransition sc = new ScaleTransition(Duration.millis(175), this);
		sc.setToX(sf);
		sc.setToY(sf);
		sc.setCycleCount(2);
		sc.setAutoReverse(true);
		getStyleClass().add("highlighting");
		sc.setOnFinished((e) -> getStyleClass().remove("highlighting"));
		sc.play();
		toFront();
	} else if (isExtracted) {
		extractedStage.toFront();
	}
}
 
開發者ID:mbway,項目名稱:Simulizer,代碼行數:23,代碼來源:InternalWindow.java

示例4: closeMdiWindow

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
public void closeMdiWindow() {
    ScaleTransition st = new ScaleTransition(Duration.millis(100), borderPane);
    st.setToX(0);
    st.setToY(0);
    st.setByX(1);
    st.setByY(1);

    st.setCycleCount(1);

    st.play();
    borderPane.fireEvent(new MDIEvent(null, MDIEvent.EVENT_CLOSED));
    st.setOnFinished((ActionEvent t) -> {

        MDICanvas mdiCanvas = (MDICanvas) this.getParent().getParent();
        for (int i = 0; i < mdiCanvas.getPaneMDIContainer().getChildren().size(); i++) {
            MDIWindow window = (MDIWindow) mdiCanvas.getPaneMDIContainer().getChildren().get(i);
            if (window.getId().equals(borderPane.getId())) {
                mdiCanvas.getPaneMDIContainer().getChildren().remove(i);
            }
        }
        isClosed.setValue(true);
    });
}
 
開發者ID:lincolnminto,項目名稱:javaFXMDI,代碼行數:24,代碼來源:MDIWindow.java

示例5: animateButton

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
/**
 * Animates a custom button with a scale transition.
 * 
 * @param pButton the button
 * @see ScaleTransition
 */
private void animateButton(Button pButton)
{
	pButton.setEffect(effButtonColorAdjust);
	
	Animation an = htButtonAnimations.get(pButton);
	
	if (an != null)
	{
		an.playFromStart();
	}
	else
	{
		ScaleTransition st = new ScaleTransition(Duration.millis(120), pButton);
		st.setByX(0.4f);
		st.setByY(0.4f);
		st.setCycleCount(2);
		st.setAutoReverse(true);
		
		htButtonAnimations.put(pButton, st);
		
		st.play();
	}
}
 
開發者ID:ivartanian,項目名稱:JVx.javafx,代碼行數:30,代碼來源:StackedScenePane.java

示例6: autoFocusPolygonAnimated

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private void autoFocusPolygonAnimated(final LocationPolygon polygon) {
    final double xScale = (foregroundPane.getBoundingBox().getWidth() / polygon.prefWidth(0))
            * Constants.ZOOM_FIT_PERCENTAGE_WIDTH;
    final double yScale = (foregroundPane.getBoundingBox().getHeight() / polygon.prefHeight(0))
            * Constants.ZOOM_FIT_PERCENTAGE_HEIGHT;
    final double scale = (xScale < yScale) ? xScale : yScale;

    final ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(500));
    scaleTransition.setToX(scale);
    scaleTransition.setToY(scale);
    scaleTransition.setCycleCount(1);
    scaleTransition.setAutoReverse(true);

    final Point2D transition = calculateTransition(scale, polygon);

    final TranslateTransition translateTransition = new TranslateTransition(Duration.millis(500));
    translateTransition.setToX(transition.getX());
    translateTransition.setToY(transition.getY());
    translateTransition.setCycleCount(1);
    translateTransition.setAutoReverse(true);

    final ParallelTransition parallelTransition
            = new ParallelTransition(this, scaleTransition, translateTransition);
    parallelTransition.play();
}
 
開發者ID:openbase,項目名稱:bco.bcozy,代碼行數:26,代碼來源:LocationPane.java

示例7: createWalletHideAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private Animation createWalletHideAnimation() {
   	try {
   		FadeTransition fade = new FadeTransition(Duration.millis(1000), this.knownWalletDetailContainer);
   		fade.setFromValue(1.0);
   		fade.setToValue(0.0);
   		fade.setCycleCount(1);
   		
   		ScaleTransition scale = new ScaleTransition(Duration.millis(1000), this.knownWalletDetailContainer);
   		scale.setFromX(1.0);
   		scale.setToX(0.1);
   		scale.setFromY(1.0);
   		scale.setToY(0.1);
   		scale.setCycleCount(1);
   		
   		ParallelTransition parallel = new ParallelTransition();
   		parallel.getChildren().addAll(fade, scale);
   		parallel.setCycleCount(1);
   		
   		return parallel;		
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return null;
	}    	
}
 
開發者ID:crypto-coder,項目名稱:firstlight,代碼行數:26,代碼來源:KnownWalletController.java

示例8: createWalletShowAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private Animation createWalletShowAnimation() {
   	try {
   		FadeTransition fade = new FadeTransition(Duration.millis(1000), this.knownWalletDetailContainer);
   		fade.setFromValue(0.0);
   		fade.setToValue(1.0);
   		fade.setCycleCount(1);
   		
   		ScaleTransition scale = new ScaleTransition(Duration.millis(1000), this.knownWalletDetailContainer);
   		scale.setFromX(0.1);
   		scale.setToX(1.0);
   		scale.setFromY(0.1);
   		scale.setToY(1.0);
   		scale.setCycleCount(1);
   		
   		ParallelTransition parallel = new ParallelTransition();
   		parallel.getChildren().addAll(fade, scale);
   		parallel.setCycleCount(1);
   		
   		return parallel;		
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
		return null;
	}    	
}
 
開發者ID:crypto-coder,項目名稱:firstlight,代碼行數:26,代碼來源:KnownWalletController.java

示例9: initialize

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
@Override
public void initialize(URL location, ResourceBundle resources) {
    propertyCollector = PropertyCollector.create();

    if (!propertyCollector.isJDKCorrect() && propertyCollector.getProperty("jdk") == null) {
        createProject.setDisable(true);
    }

    ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(2000), coconutPng);
    scaleTransition.setToX(1.1f);
    scaleTransition.setToY(1.1f);
    scaleTransition.setCycleCount(Timeline.INDEFINITE);
    scaleTransition.setAutoReverse(true);
    scaleTransition.play();
}
 
開發者ID:MrChebik,項目名稱:Coconut-IDE,代碼行數:16,代碼來源:StartPresenter.java

示例10: bounce

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
/**
 * Makes the entry view "bounce" by applying a scale transition. This is a
 * good way to make an entry stand out, e.g. when it receives the keyboard
 * focus.
 */
public final void bounce() {
    ScaleTransition transition = new ScaleTransition(Duration.millis(200), this);
    setCache(true);
    setCacheHint(CacheHint.SCALE);
    transition.setAutoReverse(true);
    transition.setFromX(1);
    transition.setToX(.8);
    transition.setFromY(1);
    transition.setToY(.8);
    transition.setCycleCount(2);
    transition.setOnFinished(evt -> setCache(false));
    transition.play();
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:19,代碼來源:EntryViewBase.java

示例11: layoutChildren

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override public void layoutChildren() {
    final boolean wasShowing = imageView.isVisible();
    final boolean isShowing = isShowing();

    imageView.setVisible(isShowing);
    if (!isShowing) {
        return;
    }

    final double glassPaneWidth = snapSize(glassPane.getWidth());
    final double glassPaneHeight = snapSize(glassPane.getHeight());

    final double imageWidth = imageView.getLayoutBounds().getWidth();
    final double imageHeight = imageView.getLayoutBounds().getHeight();

    imageView.relocate(glassPaneWidth / 2.0 - imageWidth / 2.0, glassPaneHeight / 2.0 - imageHeight / 2.0);

    if (!wasShowing && isShowing) {
        ScaleTransition st = new ScaleTransition(Duration.millis(250), imageView);
        st.setByX(1.0f);
        st.setByY(1.0f);
        st.setCycleCount(1);
        st.setAutoReverse(true);
        st.play();
    }
}
 
開發者ID:gluonhq,項目名稱:javaone2016,代碼行數:28,代碼來源:ImageViewLayer.java

示例12: startSimpleMetaDataAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private void startSimpleMetaDataAnimation() {
    float animationExtension = 3.25f;
    bulgingTransition = new ScaleTransition(Duration.millis(1000), load_image_button);
    bulgingTransition.setToX(animationExtension);
    bulgingTransition.setToY(animationExtension);
    bulgingTransition.autoReverseProperty().setValue(true);
    bulgingTransition.setCycleCount(2);
    bulgingTransition.play();
    load_image_button.setFont(Font.font("Roboto", FontWeight.NORMAL, 8));
    load_image_button.setText("Checking Metadata..");

}
 
開發者ID:afsalashyana,項目名稱:FakeImageDetection,代碼行數:13,代碼來源:LaunchScreeenController.java

示例13: startAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
private void startAnimation() {
    navigation_button.setText("Applying ELA on Image");
    float animationExtension = 1.2f;
    bulgingTransition = new ScaleTransition(Duration.millis(2000), navigation_button);
    bulgingTransition.setToX(animationExtension);
    bulgingTransition.setToY(animationExtension);
    bulgingTransition.autoReverseProperty().setValue(true);
    bulgingTransition.setCycleCount(bulgingTransition.INDEFINITE);
    bulgingTransition.play();
}
 
開發者ID:afsalashyana,項目名稱:FakeImageDetection,代碼行數:11,代碼來源:NeuralnetInterfaceController.java

示例14: JoustToken

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

	popup = new Popup();
	popup.getContent().setAll(cardToken);
	popup.setX(parent.getX() + 600);
	popup.show(parent);
	int offsetY = up ? -200 : 100;
	popup.setY(parent.getY() + parent.getHeight() * 0.5 - cardToken.getHeight() * 0.5 + offsetY);

	cardToken.setCard(card);

	NotificationProxy.sendNotification(GameNotification.ANIMATION_STARTED);
	FadeTransition animation = new FadeTransition(Duration.seconds(1.0), cardToken);
	animation.setDelay(Duration.seconds(1f));
	animation.setOnFinished(this::onComplete);
	animation.setFromValue(1);
	animation.setToValue(0);
	animation.play();
	
	if (won) {
		ScaleTransition scaleAnimation = new ScaleTransition(Duration.seconds(0.5f), cardToken);
		scaleAnimation.setByX(0.1);
		scaleAnimation.setByY(0.1);
		scaleAnimation.setCycleCount(2);
		scaleAnimation.setAutoReverse(true);
		scaleAnimation.play();	
	}
}
 
開發者ID:demilich1,項目名稱:metastone,代碼行數:31,代碼來源:JoustToken.java

示例15: playBusyAnimation

import javafx.animation.ScaleTransition; //導入方法依賴的package包/類
/**
 * Creates an animation that indicates that the selected symbol has already
 * been placed there.
 */
public void playBusyAnimation(){
    ImageView symbol = (ImageView) this.getChildren().get(0);
    ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(100), symbol);
    scaleTransition.setToX(1.10);
    scaleTransition.setToY(1.10);
    scaleTransition.setAutoReverse(true);
    scaleTransition.setCycleCount(2);
    scaleTransition.play();
}
 
開發者ID:brad-richards,項目名稱:AIGS,代碼行數:14,代碼來源:TicTacToePane.java


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