Reads annotation files
authoramwaterhouse <Andrew Waterhouse>
Fri, 3 Feb 2006 17:39:41 +0000 (17:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 3 Feb 2006 17:39:41 +0000 (17:39 +0000)
src/jalview/bin/JalviewLite.java

index 331e7f5..a26b9d0 100755 (executable)
@@ -81,15 +81,6 @@ public class JalviewLite extends Applet
 \r
         this.setBackground(new Color(r, g, b));\r
 \r
-\r
-        param = getParameter("features");\r
-        if(param!=null)\r
-        {\r
-          if(param.indexOf("://")==-1)\r
-               param = getCodeBase() + param;\r
-        }\r
-        final String featuresFile = param;\r
-\r
         file = getParameter("file");\r
         if(file.indexOf("://")==-1)\r
                file = getCodeBase() + file;\r
@@ -101,7 +92,6 @@ public class JalviewLite extends Applet
           embedded = true;\r
           LoadingThread loader = new LoadingThread(file,\r
                             "URL",\r
-                            featuresFile,\r
                             applet);\r
           loader.start();\r
         }\r
@@ -115,7 +105,6 @@ public class JalviewLite extends Applet
                     {\r
                         LoadingThread loader = new LoadingThread(file,\r
                             "URL",\r
-                            featuresFile,\r
                             applet);\r
                         loader.start();\r
                       }\r
@@ -243,18 +232,15 @@ public class JalviewLite extends Applet
         String file;\r
         String protocol;\r
         String format;\r
-        String featuresFile;\r
         JalviewLite applet;\r
 \r
         public LoadingThread(String file,\r
                              String protocol,\r
-                             String features,\r
                              JalviewLite applet)\r
         {\r
             this.file = file;\r
             this.protocol = protocol;\r
             format = jalview.io.IdentifyFile.Identify(file, "URL");\r
-            featuresFile = features;\r
             this.applet = applet;\r
         }\r
 \r
@@ -272,12 +258,13 @@ public class JalviewLite extends Applet
 \r
               currentAlignFrame.statusBar.setText("Successfully loaded file " + file);\r
 \r
-              if (featuresFile != null)\r
-                  currentAlignFrame.parseFeaturesFile(featuresFile);\r
 \r
                 String treeFile = applet.getParameter("treeFile");\r
                 if (treeFile != null)\r
                 {\r
+                  if (treeFile.indexOf("://") == -1)\r
+                  treeFile = getCodeBase() + treeFile;\r
+\r
                   try\r
                   {\r
                     jalview.io.NewickFile fin = new jalview.io.NewickFile(applet.\r
@@ -300,6 +287,28 @@ public class JalviewLite extends Applet
                   }\r
               }\r
 \r
+              String param = getParameter("features");\r
+              if (param != null)\r
+              {\r
+                if (param.indexOf("://") == -1)\r
+                  param = getCodeBase() + param;\r
+\r
+                currentAlignFrame.parseFeaturesFile(param);\r
+              }\r
+\r
+             param = getParameter("annotations");\r
+             if (param != null)\r
+             {\r
+               if (param.indexOf("://") == -1)\r
+                 param = getCodeBase() + param;\r
+\r
+               new AnnotationReader().readAnnotationFile(\r
+                   currentAlignFrame.viewport.getAlignment(),\r
+                   param);\r
+\r
+               currentAlignFrame.alignPanel.fontChanged();\r
+             }\r
+\r
 \r
                 String pdbfile = applet.getParameter("PDBFILE");\r
                 if(pdbfile!=null)\r