&& getParameter("embedded").equalsIgnoreCase("true"))\r
{\r
embedded = true;\r
- LoadingThread loader = new LoadingThread(file,\r
- AppletFormatAdapter.URL,\r
- applet);\r
+ LoadingThread loader = new LoadingThread(file, applet);\r
loader.start();\r
}\r
else if (file != null)\r
public void actionPerformed(ActionEvent e)\r
{\r
LoadingThread loader = new LoadingThread(file,\r
- AppletFormatAdapter.URL,\r
applet);\r
loader.start();\r
}\r
}\r
if ( (sequences != null) && (sequences.length > 0))\r
{\r
- AlignFrame af = new AlignFrame(new Alignment(sequences), null, args[0]);\r
+ AlignFrame af = new AlignFrame(new Alignment(sequences), null, args[0], false);\r
af.statusBar.setText("Successfully loaded file " + args[0]);\r
}\r
}\r
JalviewLite applet;\r
\r
public LoadingThread(String _file,\r
- String _protocol,\r
JalviewLite _applet)\r
{\r
file = _file;\r
if(inArchive(file))\r
protocol = AppletFormatAdapter.CLASSLOADER;\r
else\r
- protocol = _protocol;\r
-\r
+ {\r
+ file = addProtocol(file);\r
+ protocol = AppletFormatAdapter.URL;\r
+ }\r
format = new jalview.io.IdentifyFile().Identify(file, protocol);\r
applet = _applet;\r
}\r
if ((sequences != null) && (sequences.length > 0))\r
{\r
currentAlignFrame = new AlignFrame(new Alignment(sequences),\r
- applet, file);\r
+ applet,\r
+ file,\r
+ embedded);\r
\r
initialAlignFrame = currentAlignFrame;\r
\r
- if (embedded)\r
- currentAlignFrame.setEmbedded();\r
-\r
currentAlignFrame.statusBar.setText("Successfully loaded file " + file);\r
\r
\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", treeFile);\r
- addFrame(tp, treeFile, 600, 500);\r
- currentAlignFrame.addTreeMenuItem(tp, treeFile);\r
+ currentAlignFrame.loadTree(fin, treeFile);\r
}\r
}\r
catch (Exception ex)\r
*/\r
boolean inArchive(String file)\r
{\r
- return ( getClass().getResourceAsStream("/" + file) != null );\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