Java Code Examples for javafx.animation.ScaleTransition#play()
The following examples show how to use
javafx.animation.ScaleTransition#play() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GameView.java From CrazyAlpha with GNU General Public License v2.0 | 5 votes |
public static void makeScaleTransition(Node node, int millis, double byX, double byY) { ScaleTransition st = new ScaleTransition(Duration.millis(millis)); st.setByX(byX); st.setByY(byY); st.setCycleCount(Animation.INDEFINITE); st.setAutoReverse(true); st.setNode(node); st.play(); }
Example 2
Source File: InternalWindow.java From desktoppanefx with Apache License 2.0 | 5 votes |
public void closeWindow() { InternalWindowEvent event = new InternalWindowEvent(this, InternalWindowEvent.WINDOW_CLOSE_REQUEST); fireEvent(event); if (event.isConsumed()) { return; } if (isDetached()) { fireEvent(new InternalWindowEvent(this, InternalWindowEvent.WINDOW_HIDING)); detachedWindow.close(); detachedWindow = null; fireEvent(new InternalWindowEvent(this, InternalWindowEvent.WINDOW_HIDDEN)); } else { ScaleTransition st = hideWindow(); st.setOnFinished(t -> { if (desktopPane != null) { desktopPane.removeInternalWindow(this); } closed.setValue(true); fireEvent(new InternalWindowEvent(this, InternalWindowEvent.WINDOW_HIDDEN)); }); fireEvent(new InternalWindowEvent(this, InternalWindowEvent.WINDOW_HIDING)); st.play(); } }
Example 3
Source File: LaunchScreeenController.java From FakeImageDetection with GNU General Public License v3.0 | 5 votes |
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.."); }
Example 4
Source File: NeuralnetInterfaceController.java From FakeImageDetection with GNU General Public License v3.0 | 5 votes |
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(); }
Example 5
Source File: JoustToken.java From metastone with GNU General Public License v2.0 | 5 votes |
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(); } }