load/get Annotation
authoramwaterhouse <Andrew Waterhouse>
Thu, 25 Jan 2007 16:02:21 +0000 (16:02 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 25 Jan 2007 16:02:21 +0000 (16:02 +0000)
src/jalview/bin/JalviewLite.java

index ef7f582..de9a4a7 100755 (executable)
@@ -43,6 +43,7 @@ public class JalviewLite extends Applet
   ///////////////////////////////////////////\r
   //The following public methods maybe called\r
   //externally, eg via javascript in HTML page\r
+\r
   public String getSelectedSequences()\r
     {\r
       StringBuffer result = new StringBuffer("");\r
@@ -82,11 +83,31 @@ public class JalviewLite extends Applet
       }\r
     }\r
 \r
+    public void loadAnnotation(String annotation)\r
+    {\r
+      if (new AnnotationFile().readAnnotationFile(\r
+          currentAlignFrame.getAlignViewport().getAlignment(), annotation,\r
+          AppletFormatAdapter.PASTE))\r
+      {\r
+        currentAlignFrame.alignPanel.fontChanged();\r
+        currentAlignFrame.alignPanel.setScrollValues(0, 0);\r
+      }\r
+      else\r
+      {\r
+        currentAlignFrame.parseFeaturesFile(annotation, AppletFormatAdapter.PASTE);\r
+      }\r
+    }\r
+\r
     public String getFeatures(String format)\r
     {\r
       return currentAlignFrame.outputFeatures(false, format);\r
     }\r
 \r
+    public String getAnnotation()\r
+    {\r
+      return currentAlignFrame.outputAnnotations(false);\r
+    }\r
+\r
     public void loadAlignment(String text, String title)\r
     {\r
         Alignment al = null;\r
@@ -103,11 +124,11 @@ public class JalviewLite extends Applet
         }\r
    }\r
 \r
-\r
     ////////////////////////////////////////////////\r
     ////////////////////////////////////////////////\r
 \r
 \r
+\r
     static int lastFrameX = 200;\r
     static int lastFrameY = 200;\r
     boolean fileFound = true;\r