documentation for groovy console and basic groovy scripting support
authorjprocter <Jim Procter>
Fri, 11 Jan 2008 13:53:39 +0000 (13:53 +0000)
committerjprocter <Jim Procter>
Fri, 11 Jan 2008 13:53:39 +0000 (13:53 +0000)
help/html/features/groovy.html [new file with mode: 0644]

diff --git a/help/html/features/groovy.html b/help/html/features/groovy.html
new file mode 100644 (file)
index 0000000..1a0b83c
--- /dev/null
@@ -0,0 +1,46 @@
+<html>\r
+<head><title>Groovy Shell</title></head>\r
+<body>\r
+<p><strong>The Groovy Shell</strong></p>\r
+<p><a href="http://groovy.codehaus.org/">Groovy</a> is an &quot;<em>agile and dynamic \r
+language for the Java platform</em>&quot;. The groovy scripting language makes it \r
+extremely easy to programmatically interact with Java programs, in much the same \r
+way that Javascript is used to generate and interact with applets and other \r
+objects on the page.</p>\r
+<p><em>Opening the Groovy Console</em><br>If groovy is available, then the \r
+<strong>Tools&#8594;Groovy Console...</strong> menu entry will be available \r
+from the Jalview Desktop's drop-down menu. Selecting this will open the\r
+<a href="http://groovy.codehaus.org/Groovy+Console">Groovy Console</a> which \r
+allows you to interactively execute Groovy scripts within the Jalview run-time environment.</p>\r
+<p><em>Executing groovy scripts on Jalview startup</em><br>\r
+The -groovy &lt;script&gt; option on the <a href="commandline.html"/>Jalview command line</a>command line option will </p>\r
+<p>There is as yet no properly defined scripting interface to Jalview, but all the\r
+public methods of the jalview class hierarchy can be called from Groovy scripts. \r
+The access point for this is the <strong>Jalview</strong> object defined in\r
+the groovy environent which corresponds to the <pre>jalview.gui.Desktop</pre> object which\r
+manages all the Jalview windows.</p>  \r
+Here's an example to get you started:<br>\r
+<ul><li>Getting the title, alignment and first sequence from the current alignFrame<br>\r
+<pre>\r
+def alf = Jalview.getAlignframes();\r
+print alf[0].getTitle();\r
+def alignment = alf[0].viewport.alignment;\r
+def seq = alignment.getSequenceAt(0);\r
+</pre>\r
+</li>\r
+</ul>\r
+</p>\r
+<p><strong>Getting Groovy...<br></strong>\r
+Jalview Groovy support is only possible if the core groovy \r
+jars which include the GroovyShell are present on the CLASSPATH \r
+when Jalview is started. <p>The jars are obtained from the \r
+<em>embedded</em> directory within the <a \r
+href="http://dist.codehaus.org/groovy/distributions">groovy \r
+distribution</a>. The easiest way of adding them to the \r
+Jalview classpath is to download and build jalview from \r
+it's source distribution, and then add the groovy-all-*.jar \r
+to the lib directory whose path is given in the java.ext.dirs property.</p>\r
+\r
+<p>&nbsp;</p>\r
+</body>\r
+</html>\r