X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=doc%2FAddingGroovySupport.html;h=e3e453f89a51bcc1286a7f9c6f52e3af2b15492d;hb=5022579ec6cc4eecfabd9df69e0fb039e3186a0a;hp=efefcc2d261ffc3e76bceab3eb4e269ccdc0c484;hpb=dc5507ccf4bf0c8b20f86aee7175c16b68ef52ea;p=jalview.git diff --git a/doc/AddingGroovySupport.html b/doc/AddingGroovySupport.html index efefcc2..e3e453f 100644 --- a/doc/AddingGroovySupport.html +++ b/doc/AddingGroovySupport.html @@ -1,122 +1,47 @@ - -Adding Groovy Support to Jalview - - -

-Adding Groovy Support to Jalview -

-

-There is currently no scripting language -extension within Jalview, in part because a -scripting API has not been developed. -

-

It is, however, really easy to embed scripting -engines within Jalview. We haven't done it -with the Bean Scripting Framework, but the -code snippets below show you how to get going -with groovy. -

-

Modifications

-

-For each class below, add the following objects and methods to their definitions. -

- -

-Finally, compile and run with the groovy-all-*.jar (get the jar -from the embedded directory within the groovy distribution). -Then, you should be able to open the Groovy shell -window from the Desktop's Tools menu. To check things are working, -try a simple test script :
-

-  
-  print Jalview.getAlignframes()[0].getTitle();
-
-Executing this will print the title of the first alignment loaded into Jalview.

- -

TODO

-

-Using Java class methods from Groovy is straightforward, but currently, there isn't a set of easy to use methods for the jalview objects. A Jalview Scripting API needs to be developed to make this easier.

-

Making it easier

-

jalview.bin.JalviewScript could be a top level jalview instance of a script execution thread, creating and maintaining the context for scripts operating on the jalview datamodel and interfacing with the Jalview GUI. -

- - - + + +Adding Groovy Support to Jalview + + +

+Groovy Support in Jalview +

+

+ Groovy has been bundled with the Jalview desktop since circa 2012. The program supports interactive execution of groovy scripts via the Groovy Console, and command line execution via the '-groovy' option. The main source for documentation about Groovy in Jalview is the online help pages. +

+

Here are some scripts to get you started:

+ +

TODO

+

+Using Java class methods from Groovy is straightforward, but currently, there isn't a set of easy to use methods for the jalview objects. A Jalview Scripting API needs to be developed to make this easier.

+

Making it easier

+

jalview.bin.JalviewScript could be a top level jalview instance of a script execution thread, creating and maintaining the context for scripts operating on the jalview datamodel and interfacing with the Jalview GUI. +

+ + +