allow groovy scripts to be run when in headless mode - pass startupAlFrame as context
authorjprocter <Jim Procter>
Thu, 7 Apr 2011 22:08:42 +0000 (22:08 +0000)
committerjprocter <Jim Procter>
Thu, 7 Apr 2011 22:08:42 +0000 (22:08 +0000)
src/jalview/bin/Jalview.java

index 2b935ed..ba2d3bd 100755 (executable)
@@ -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 });