Fixed RT-15426: UE: default preloader should not fade out in webstart mode diff -r bdeeda91617c javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/FXPreloader.java --- a/javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/FXPreloader.java Thu Aug 25 20:37:26 2011 -0700 +++ b/javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/FXPreloader.java Fri Aug 26 00:00:57 2011 -0700 @@ -58,7 +58,7 @@ */ FXPreloader() { DeployPerfLogger.timestamp("(start) Construct preloader [default]"); - fxPreview = new FXDefaultPreloader(null); + fxPreview = new FXDefaultPreloader(); DeployPerfLogger.timestamp("(done) Construct preloader [default]"); } @@ -66,7 +66,7 @@ FXPreloader(Applet2Context a2c, FXWindow window) { DeployPerfLogger.timestamp("(start) Construct preloader [default]"); this.window = window; - fxPreview = new FXDefaultPreloader(a2c); + fxPreview = new FXDefaultPreloader(); String unnamed[] = Utils.getUnnamed(a2c); Map named = Utils.getNamedParameters(a2c); ParametersImpl.registerParameters(fxPreview, diff -r bdeeda91617c javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/ui/FXDefaultPreloader.java --- a/javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/ui/FXDefaultPreloader.java Thu Aug 25 20:37:26 2011 -0700 +++ b/javafx-deploy/src/com/sun/deploy/uitoolkit/impl/fx/ui/FXDefaultPreloader.java Fri Aug 26 00:00:57 2011 -0700 @@ -1,6 +1,5 @@ package com.sun.deploy.uitoolkit.impl.fx.ui; -import com.sun.applet2.Applet2Context; import com.sun.deploy.uitoolkit.impl.fx.ui.resources.ResourceManager; import com.sun.javafx.css.Styleable; import com.sun.javafx.css.StyleManager; @@ -40,18 +39,7 @@ double currentWidth=0; double currentHeight=0; - //TODO: can use it here but custom preloader can not do this!!! need better way - Applet2Context a2c; - - public FXDefaultPreloader() { - this(null); - } - - //a2c == null => webstart mode - //otherwise applet - public FXDefaultPreloader(Applet2Context a2c) { - this.a2c = a2c; - } + boolean isEmbedded; @Override public void init() { @@ -62,6 +50,7 @@ public void start(Stage stage) { this.stage = stage; this.stage.setTitle("JavaFX Application Preview"); + this.isEmbedded = (stage.getWidth() >= 0 && stage.getHeight() >= 0); } private void showIfNeeded() { @@ -84,12 +73,16 @@ switch (evt.getType()) { case BEFORE_START: if (stage.isShowing()) { - // do something more interesting here.... - FadeTransition ft = new FadeTransition(Duration.millis(FADE_DURATION), pane); - ft.setFromValue(1.0); - ft.setToValue(0.0); - ft.setOnFinished(new FadeOutFinisher(stage)); - ft.play(); + if (isEmbedded) { + // do something more interesting here.... + FadeTransition ft = new FadeTransition(Duration.millis(FADE_DURATION), pane); + ft.setFromValue(1.0); + ft.setToValue(0.0); + ft.setOnFinished(new FadeOutFinisher(stage)); + ft.play(); + } else { + stage.hide(); + } } //already hidden. do nothing break;