Only load the tree file once, for first alignment
authoramwaterhouse <Andrew Waterhouse>
Fri, 9 Dec 2005 11:13:18 +0000 (11:13 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 9 Dec 2005 11:13:18 +0000 (11:13 +0000)
src/jalview/bin/JalviewLite.java

index d5801df..be4675f 100755 (executable)
@@ -28,6 +28,7 @@ import java.applet.*;
 \r
 import java.awt.*;\r
 import java.awt.event.*;\r
+import jalview.appletgui.TreePanel;\r
 \r
 \r
 /**\r
@@ -243,6 +244,32 @@ public class JalviewLite extends Applet
                 if(featuresFile!=null)\r
                   currentAlignFrame.parseFeaturesFile(featuresFile);\r
 \r
+                String treeFile = applet.getParameter("treeFile");\r
+                if (treeFile != null)\r
+                {\r
+                  try\r
+                  {\r
+                    jalview.io.NewickFile fin = new jalview.io.NewickFile(applet.\r
+                        getCodeBase() + treeFile, "URL");\r
+                    fin.parse();\r
+\r
+                    if (fin.getTree() != null)\r
+                    {\r
+                      TreePanel tp = null;\r
+                      tp = new TreePanel(currentAlignFrame.viewport,\r
+                                         currentAlignFrame.viewport.getAlignment().getSequences(),\r
+                                         fin, "FromFile", applet.getCodeBase() + treeFile);\r
+                      jalview.bin.JalviewLite.addFrame(tp, treeFile, 600, 500);\r
+                      currentAlignFrame.addTreeMenuItem(tp, treeFile);\r
+                    }\r
+                  }\r
+                  catch (Exception ex)\r
+                  {\r
+                    ex.printStackTrace();\r
+                  }\r
+              }\r
+\r
+\r
                 String pdbfile = applet.getParameter("PDBFILE");\r
                 if(pdbfile!=null)\r
                 {\r
@@ -256,8 +283,6 @@ public class JalviewLite extends Applet
                     new MCview.AppletPDBViewer(pdbfile, "URL",\r
                                                (Sequence)currentAlignFrame.getAlignViewport().getAlignment().findName(sequence),\r
                                                currentAlignFrame.getSeqcanvas());\r
-\r
-\r
                   }\r
 \r
                 }\r