From: jprocter Date: Fri, 6 Aug 2010 11:04:56 +0000 (+0000) Subject: interactive/batch mode test for groovy scripting (See JAL-611) X-Git-Tag: Release_2_6~137 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dfd8d228991732db0871b4b2a9ea19838d9b45b9;p=jalview.git interactive/batch mode test for groovy scripting (See JAL-611) --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index fc6d23e..b599f0f 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -179,6 +179,7 @@ public class Jalview if (!headless) { desktop = new Desktop(); + desktop.setInBatchMode(true); // indicate we are starting up desktop.setVisible(true); desktop.startServiceDiscovery(); if (!aparser.contains("nousagestats")) @@ -536,7 +537,7 @@ public class Jalview startFeatureFetching(getFeatures); } } - // execute a groovy script. + // Once all other stuff is done, execute any groovy scripts (in order) if (groovyscript != null) { if (jalview.bin.Cache.groovyJarsPresent()) @@ -551,8 +552,11 @@ public class Jalview + groovyscript); } } - - // Once all other stuff is done, execute any groovy scripts (in order) + // and finally, turn off batch mode indicator - if the desktop still exists + if (desktop!=null) + { + desktop.setInBatchMode(false); + } } private static void startUsageStats(final Desktop desktop) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 0bf029c..b35495f 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -2088,6 +2088,29 @@ public class Desktop extends jalview.jbgui.GDesktop implements return v_client; } + /** + * flag set if jalview GUI is being operated programmatically + */ + private boolean inBatchMode=false; + + /** + * check if jalview GUI is being operated programmatically + * @return inBatchMode + */ + public boolean isInBatchMode() + { + return inBatchMode; + } + + /** + * set flag if jalview GUI is being operated programmatically + * @param inBatchMode + */ + public void setInBatchMode(boolean inBatchMode) + { + this.inBatchMode = inBatchMode; + } + public void startServiceDiscovery() {