From c539b2d33b3809958aad1a4dee80c8c98d20f00e Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 7 Apr 2011 22:08:42 +0000 Subject: [PATCH] allow groovy scripts to be run when in headless mode - pass startupAlFrame as context --- src/jalview/bin/Jalview.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 2b935ed..ba2d3bd 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -442,7 +442,7 @@ public class Jalview if (jalview.bin.Cache.groovyJarsPresent()) { System.out.println("Executing script " + groovyscript); - executeGroovyScript(groovyscript, desktop); + executeGroovyScript(groovyscript, new Object[] {desktop,af}); } else { @@ -544,7 +544,7 @@ public class Jalview if (jalview.bin.Cache.groovyJarsPresent()) { System.out.println("Executing script " + groovyscript); - executeGroovyScript(groovyscript, desktop); + executeGroovyScript(groovyscript, new Object[] { desktop, startUpAlframe}); } else { @@ -601,7 +601,7 @@ public class Jalview * 'Jalview' object. */ private static void executeGroovyScript(String groovyscript, - Object jalviewContext) + Object[] jalviewContext) { if (jalviewContext == null) { @@ -678,7 +678,7 @@ public class Jalview new Class[] { String.class, Object.class }); setvar.invoke(gbinding, new Object[] - { "Jalview", jalviewContext }); + { "Jalview", jalviewContext[0],"startupAlFrame",jalviewContext[1] }); Class gsec = cl.loadClass("groovy.util.GroovyScriptEngine"); Constructor gseccons = gsec.getConstructor(new Class[] { URL[].class }); // String[].class }); -- 1.7.10.2