From: Ben Soares Date: Thu, 6 Jun 2024 10:17:41 +0000 (+0100) Subject: JAL-4358 Add the JALVIEW: CREATED DESKTOP line to java app and look out for it in... X-Git-Tag: Release_2_11_4_0~25^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=80c10300e59a40ced95d54e85c5cbbc40e5d3f34;p=jalview.git JAL-4358 Add the JALVIEW: CREATED DESKTOP line to java app and look out for it in Getdown to close the splash screen --- diff --git a/getdown/lib/getdown-core.jar b/getdown/lib/getdown-core.jar index b2b4fae..abc2c7a 100644 Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ diff --git a/getdown/lib/getdown-launcher-local.jar b/getdown/lib/getdown-launcher-local.jar index 149c9e6..368c124 100644 Binary files a/getdown/lib/getdown-launcher-local.jar and b/getdown/lib/getdown-launcher-local.jar differ diff --git a/getdown/lib/getdown-launcher.jar b/getdown/lib/getdown-launcher.jar index 6a0f1a1..3e0cb62 100644 Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index ed5570c..200e743 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -1050,6 +1050,7 @@ public abstract class Getdown extends Thread */ protected abstract void exit (int exitCode); + private static boolean _disposed = false; /** * Copies the supplied stream from the specified input to the specified output. Used to copy * our child processes stderr and stdout to our own stderr and stdout. @@ -1060,6 +1061,19 @@ public abstract class Getdown extends Thread BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String line; while ((line = reader.readLine()) != null) { + // check for desktop creation line and end early + if (!_disposed && line.endsWith("JALVIEW: CREATED DESKTOP")) { + // pump the percent up to 100% + if (_latestInstance != null) { + _latestInstance.setStatusAsync(null, 100, -1L, false); + // only running disposeContainer to remove the visual frame. + // Allow getdown to carry on running until timeout to capture more log lines. + _latestInstance.disposeContainer(); + _disposed = true; + } else { + // let nature take its course + } + } out.println(line); out.flush(); } @@ -1141,6 +1155,11 @@ public abstract class Getdown extends Thread } + // set the instance + protected static void setInstance(Getdown app) { + _latestInstance = app; + } + protected Application _app; protected Application.UpdateInterface _ifc = new Application.UpdateInterface(Config.EMPTY); @@ -1179,4 +1198,5 @@ public abstract class Getdown extends Thread protected static final int MAX_LOOPS = 5; protected static final long FALLBACK_CHECK_TIME = 1000L; + private static Getdown _latestInstance = null; } diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 3eb9450..dbc50db 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -290,6 +290,7 @@ public class GetdownApp Application.setStartupFilesFromParameters(getStartupFilesParameters()); } + Getdown.setInstance(app); app.start(); return app; } diff --git a/j11lib/getdown-core.jar b/j11lib/getdown-core.jar index b2b4fae..abc2c7a 100644 Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ diff --git a/j8lib/getdown-core.jar b/j8lib/getdown-core.jar index b2b4fae..abc2c7a 100644 Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index fd961eb..878bc39 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -660,11 +660,10 @@ public class Desktop extends jalview.jbgui.GDesktop }); desktop.addMouseListener(ma); - if (Platform.isJS()) - { - // used for jalviewjsTest - jalview.bin.Console.info("JALVIEWJS: CREATED DESKTOP"); - } + // This is important for jalviewjsTest task and also early Getdown + // splashscreen removal + jalview.bin.Console.info((Platform.isJS() ? "JALVIEWJS" : "JALVIEW") + + ": CREATED DESKTOP"); }