+ if (treeFile != null)\r
+ {\r
+ try\r
+ {\r
+ if(inArchive(treeFile))\r
+ protocol = AppletFormatAdapter.CLASSLOADER;\r
+ else\r
+ {\r
+ protocol = AppletFormatAdapter.URL;\r
+ treeFile = addProtocol(treeFile);\r
+ }\r
+\r
+ jalview.io.NewickFile fin = new jalview.io.NewickFile(treeFile, protocol);\r
+\r
+ fin.parse();\r
+\r
+ if (fin.getTree() != null)\r
+ {\r
+ currentAlignFrame.loadTree(fin, treeFile);\r
+ }\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+\r
+ String param = getParameter("features");\r
+ if (param != null)\r
+ {\r
+ if( !inArchive(param) )\r
+ param = addProtocol( param );\r
+\r
+ currentAlignFrame.parseFeaturesFile(param, protocol);\r
+ }\r
+\r
+ param = getParameter("showFeatureSettings");\r
+ if(param !=null && param.equalsIgnoreCase("true"))\r
+ {\r
+ currentAlignFrame.viewport.showSequenceFeatures(true);\r
+ currentAlignFrame.featureSettings_actionPerformed();\r
+ }\r
+\r
+ param = getParameter("annotations");\r
+ if (param != null)\r
+ {\r
+ if( !inArchive(param) )\r
+ param = addProtocol( param );\r
+\r
+ new AnnotationFile().readAnnotationFile(\r
+ currentAlignFrame.viewport.getAlignment(),\r
+ param);\r
+\r
+ currentAlignFrame.alignPanel.fontChanged();\r
+ currentAlignFrame.alignPanel.setScrollValues(0,0);\r
+\r
+ }\r
+\r
+ param = getParameter("jnetfile");\r
+ if (param != null)\r
+ {\r
+ try\r
+ {\r
+ if (inArchive(param))\r
+ protocol = AppletFormatAdapter.CLASSLOADER;\r
+ else\r
+ {\r
+ protocol = AppletFormatAdapter.URL;\r
+ param = addProtocol(param);\r
+ }\r
+\r
+ jalview.io.JPredFile predictions = new jalview.io.JPredFile(\r
+ param, protocol);\r
+ new JnetAnnotationMaker().add_annotation(predictions,\r
+ currentAlignFrame.viewport.getAlignment(),\r
+ 0,false); // do not add sequence profile from concise output\r
+ currentAlignFrame.alignPanel.fontChanged();\r
+ currentAlignFrame.alignPanel.setScrollValues(0, 0);\r
+ } catch (Exception ex) {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+\r
+\r
+ String pdbfile = applet.getParameter("PDBFILE");\r
+ if(pdbfile!=null)\r
+ {\r
+ if( inArchive(pdbfile) )\r
+ protocol = AppletFormatAdapter.CLASSLOADER;\r
+ else\r
+ {\r
+ protocol = AppletFormatAdapter.URL;\r
+ pdbfile = addProtocol(pdbfile);\r
+ }\r
+\r
+ String sequence = applet.getParameter("PDBSEQ");\r
+\r
+ if(sequence!=null)\r
+ {\r
+ new MCview.AppletPDBViewer(pdbfile, protocol,\r
+ (Sequence)currentAlignFrame.getAlignViewport().getAlignment().findName(sequence),\r
+ currentAlignFrame.getSeqcanvas());\r
+ }\r
+\r
+ }\r
+ }\r
+ else\r
+ {\r
+ fileFound = false;\r
+ remove(launcher);\r
+ repaint();\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Discovers whether the given file is in the Applet Archive\r
+ * @param file String\r
+ * @return boolean\r
+ */\r
+ boolean inArchive(String file)\r
+ {\r
+ //This might throw a security exception in certain browsers\r
+ //Netscape Communicator for instance.\r
+ try{\r
+ return (getClass().getResourceAsStream("/" + file) != null);\r
+ }catch(Exception ex)\r
+ {\r
+ System.out.println("Exception checking resources: "+file+" "+ex);\r
+ return false;\r
+ }\r
+ }\r
+\r
+ String addProtocol(String file)\r
+ {\r
+ if (file.indexOf("://") == -1)\r
+ file = getCodeBase() + file;\r
+\r
+ return file;\r
+ }\r
+\r
+ }\r
+}\r