JDK-8123087 : Problems animating pane in Popup
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-27
  • Updated: 2015-06-17
  • Resolved: 2013-10-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Description
I'm trying to animate a popup window. The animation on the opacity works OK but trying to animate the scaleX or scaleY property does strange things. Try the enclosed program and press the 'Show Popup' button. Nothing appears but some graphical garbage. Strangely, changing the keyframe times to 3000 and 6000 milliseconds (instead of 300 and 600) makes it work OK, albeit taking longer. This used to work in earlier versions of jdk8.

import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.geometry.Bounds;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.stage.Popup;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.util.Duration;

public class PopupBug extends Application {
	public static void main(String[] args) {
		Application.launch(args);
	}

	public void start(Stage stage) throws Exception {
		Label l = new Label("I'm a popup!");
		l.setStyle("-fx-font-size: 3em; -fx-text-fill: white;");
		BorderPane p = new BorderPane(l);
		p.setStyle("-fx-padding:20; -fx-border-style: solid; -fx-border-width: 2; -fx-border-color: blue; -fx-background-color: black;");

		Button b = new Button("Show Popup");
		b.setOnAction((e) -> showPopup(b, p));
		BorderPane bp = new BorderPane(b);
		Scene scene = new Scene(bp, 800, 600);
		stage.setScene(scene);
		stage.show();
	}

	public void showPopup(Node refNode, Pane pane) {
		Scene scene = refNode.getScene();
		Window parent = scene.getWindow();
		if (parent != null) {
			Bounds sb = refNode.localToScene(refNode.getLayoutBounds());
			Popup pop = new Popup();
			pop.setAutoHide(true);
			pop.setAutoFix(true);
			pop.setHideOnEscape(true);
			pop.getContent().add(pane);
			pop.show(refNode, sb.getMinX() + parent.getX() + scene.getX(), sb.getMaxY() + parent.getY() + scene.getY());
			Node an = pane;
			new Timeline(
					new KeyFrame(Duration.millis(0),
							new KeyValue(an.scaleXProperty(), 0.2),
							new KeyValue(an.scaleYProperty(), 0.2)
					),
					new KeyFrame(Duration.millis(300),
							new KeyValue(an.scaleXProperty(), 1.1),
							new KeyValue(an.scaleYProperty(), 1.1)
					),
					new KeyFrame(Duration.millis(600),
							new KeyValue(an.scaleXProperty(), 1.0),
							new KeyValue(an.scaleYProperty(), 1.0)
					)
			).play();
		}
	}
}

Comments
Indeed, I cannot reproduce after fix for RT-30750. Marking as fixed.
21-10-2013

Well, this is most probably not a controls issue. It is well possible it's another manifestation of RT-30750. Assigning to myself until this is resolved.
06-06-2013

Works fine on SW pipeline. Assigning to Graphics.
28-05-2013