Skip to content

Commit

Permalink
Add StageStyle property
Browse files Browse the repository at this point in the history
  • Loading branch information
roskenet committed Mar 29, 2017
1 parent a5fe14e commit 0d37824
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>de.roskenet</groupId>
<artifactId>springboot-javafx-support</artifactId>
<version>1.3.11</version>
<version>1.3.12</version>
<packaging>jar</packaging>

<name>springboot-javafx-support</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
import org.springframework.core.env.Environment;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

/**
* @author Felix Roske
Expand Down Expand Up @@ -69,6 +71,15 @@ public void init() throws Exception {

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

String stageStyle = applicationContext.getEnvironment().getProperty("javafx.stage.style");
// User requests a different StageStyle?
// Then we need a new one:
if(stageStyle != null) {
StageStyle style = StageStyle.valueOf(stageStyle.toUpperCase());
stage = new Stage(style);
}

AbstractJavaFxApplicationSupport.stage = stage;
showView(savedInitialView);
}
Expand Down Expand Up @@ -103,6 +114,7 @@ public static void showView(Class<? extends AbstractFxmlView> newView) {
}
stage.getIcons().addAll(icons);
// stage.centerOnScreen();

stage.show();
}

Expand Down

0 comments on commit 0d37824

Please sign in to comment.