sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 03/03: Hide the splash screen after application startup.
Date Fri, 21 Aug 2020 18:05:21 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 396816fd527b757baf60ae75769bbb76bc3be28d
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Fri Aug 21 19:43:47 2020 +0200

    Hide the splash screen after application startup.
---
 .../src/main/java/org/apache/sis/gui/DataViewer.java           | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
index c8479d1..a9ad25b 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/DataViewer.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
+import java.awt.SplashScreen;
 import javafx.application.Application;
 import javafx.application.Platform;
 import javafx.geometry.Rectangle2D;
@@ -74,7 +75,7 @@ public class DataViewer extends Application {
          * (tested on Java 14 and JavaFX 14).
          */
         java.awt.im.InputContext.getInstance();
-        launch(args);
+        launch(DataViewer.class, args);
     }
 
     /**
@@ -181,6 +182,13 @@ public class DataViewer extends Application {
         window.setWidth (0.75 * bounds.getWidth());
         window.setHeight(0.75 * bounds.getHeight());
         window.show();
+        /*
+         * Hide splash screen after the main window became visible.
+         */
+        final SplashScreen sp = SplashScreen.getSplashScreen();
+        if (sp != null) {
+            sp.close();
+        }
     }
 
     /**


Mime
View raw message