diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 95d1467..b492324 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,7 +4,7 @@ com.averydonovan SkewTVSP Skew-T Virtual Sounding Plotter - 0.3.0-alpha.4 + 0.3.0-alpha.5 http://github.com/averydonovan/SkewTVirtualSoundingPlotter/ 2016 diff --git a/pom.xml b/pom.xml index e287036..2a525a1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.averydonovan SkewTVSP - 0.3.0-alpha.4 + 0.3.0-alpha.5 jar UTF-8 diff --git a/src/main/java/com/averydonovan/skewtvsp/SkewTVSP.java b/src/main/java/com/averydonovan/skewtvsp/SkewTVSP.java index d288366..261c544 100644 --- a/src/main/java/com/averydonovan/skewtvsp/SkewTVSP.java +++ b/src/main/java/com/averydonovan/skewtvsp/SkewTVSP.java @@ -35,6 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static javafx.application.Application.launch; +import javafx.stage.Screen; /** * Main class for application. Loads main window from FXML file. @@ -48,8 +49,12 @@ public class SkewTVSP extends Application { @Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("/fxml/STVSP.fxml")); - - Scene scene = new Scene(root, 1149, 700); + + int screenHeight = (int) (Screen.getPrimary().getBounds().getHeight()*10)/11; + int screenWidth = (screenHeight*9)/12 + 220; + + //Scene scene = new Scene(root, 1100, 1000); + Scene scene = new Scene(root, screenWidth, screenHeight); primaryStage.titleProperty().bind(STVSPController.windowTitle); primaryStage.setScene(scene); diff --git a/src/main/java/com/averydonovan/skewtvsp/controllers/STVSPController.java b/src/main/java/com/averydonovan/skewtvsp/controllers/STVSPController.java index fb0982a..30c14bd 100644 --- a/src/main/java/com/averydonovan/skewtvsp/controllers/STVSPController.java +++ b/src/main/java/com/averydonovan/skewtvsp/controllers/STVSPController.java @@ -694,7 +694,7 @@ protected void doSaveSkewT(ActionEvent event) { chooser.setInitialFileName(initFileName); ExtensionFilter fileExtsPNG = new ExtensionFilter("PNG images", "*.png", "*.PNG"); chooser.getExtensionFilters().addAll(fileExtsPNG); - File file = chooser.showSaveDialog(anchorPane.getScene().getWindow()); + File file = chooser.showSaveDialog(getMainStage()); // Only try to save plot if a location and filename was chosen if (file != null) { diff --git a/src/main/resources/fxml/STVSP.fxml b/src/main/resources/fxml/STVSP.fxml index 0b0ef6b..d1603e9 100644 --- a/src/main/resources/fxml/STVSP.fxml +++ b/src/main/resources/fxml/STVSP.fxml @@ -26,9 +26,9 @@ - + - + @@ -215,7 +215,7 @@ - +