Undecorator – Final “Stage”


Undecorator 1.0, not bug free but finally at a usable stage!

In this “1.0″ version you will get the following improvements:

  1. An experimental “docking” feature on screen’s edges
  2. Full screen capability in Stage’s menu
    1. Despite a JavaFX bug  on Mac OS: popup menu are not well displayed (http://javafx-jira.kenai.com/browse/RT-19457)
Full screen menu item

Full screen menu item

3. Fade transition on window showing and closing

    undecoratorScene.setFadeTransitionEnabled();

4. Localization of messages (maximize, minimize …)

5. UTILITY stage style support The usage of UTILITY Stage style is:

/**
 * UndecoratorScene constructor
 * @param stage The main stage
 * @param stageStyle could be StageStyle.UTILITY or StageStyle.TRANSPARENT
 * @param root your UI to be displayed in the Stage
 * @param stageDecorationFxml Your own Stage decoration or null to use the built-in one
 */
 public UndecoratorScene(Stage stage, StageStyle stageStyle, Parent root, String stageDecorationFxml)

Take a look!

Try!

Executable jar file is still here:macJar and to access to the code, project and binaries it’s still there:github-logo-transparent

How to use it

public class UndecoratorSceneDemo extends Application {

@Override
 public void start(final Stage stage) throws Exception {

// The Undecorator as a Scene
 Region root = FXMLLoader.load(getClass().getResource("ClientArea.fxml"));
 final UndecoratorScene undecoratorScene = new UndecoratorScene(stage, root);

// Enable fade transition
 undecoratorScene.setFadeInTransition();

/*
 * Fade transition on window closing request
 */
 stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
 @Override
 public void handle(WindowEvent we) {
 we.consume(); // Do not hide
 undecoratorScene.setFadeOutTransition();
 }
 });

stage.setScene(undecoratorScene);
 stage.sizeToScene();
 stage.toFront();

 // Set minimum size based on client area's minimum sizes
 Undecorator undecorator = undecoratorScene.getUndecorator();
 stage.setMinWidth(undecorator.getMinWidth());
 stage.setMinHeight(undecorator.getMinHeight());

 stage.show();
 }

}

What is coming next?

I’ll make a break on the improvement of the Undecorator series and I’ll concentrate my efforts on using it as a stage decorator for my other projects, so I’ll certainly provides updates if it’s not sufficient, especially on Mac OS where maximization on top of the screen and fullscreen capability  have some trouble…
Stay tuned :-) !

As usual, please give your feedbacks,

Thanks!

About these ads

  1. #1 by Albert Suen on 04/03/2013 - 07:29

    How to handle event of ClientArea ?

    • #2 by arnaud nouard on 04/03/2013 - 09:15

      Hi,
      The “ClientArea” is your responsability. This is your UI, the same as you would add as root of a classic Scene. The event handler should be the same with or without the Undecorator.
      Thanks.

  2. #3 by Fernando on 13/06/2013 - 20:21

    Great job,
    Have you tried using the HTMLEditor control with Undecorator?
    All my HTMLEditor controls are transparent!

    • #4 by arnaud nouard on 17/06/2013 - 18:43

      Thanks Fernando.
      Regarding the HTMLEditor, the demo contains one. Do you have same result with the executable jar of the post?
      Thanks.

  1. Java desktop links of the week, March 4 | Jonathan Giles
  2. JavaFX links of the week, March 4 // JavaFX News, Demos and Insight // FX Experience

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: