groovy scripting examples (JAL-???)
[jalview.git] / examples / groovy / printtitle.groovy
diff --git a/examples/groovy/printtitle.groovy b/examples/groovy/printtitle.groovy
new file mode 100644 (file)
index 0000000..8fe91db
--- /dev/null
@@ -0,0 +1,12 @@
+// do something groovy in jalview\r
+print "Hello World.\n";\r
+def alf = Jalview.getAlignframes();\r
+for (ala in alf)\r
+{\r
+       // ala is an jalview.gui.AlignFrame object \r
+       print ala.getTitle()+"\n";\r
+       // get the parent jalview.datamodel.Alignment from the alignment viewport\r
+       def alignment = ala.viewport.alignment;\r
+       // get the first sequence from the jalview.datamodel.Alignment object\r
+       def seq = alignment.getSequenceAt(0); \r
+}\r