}\r
\r
String format = jalview.io.IdentifyFile.Identify(args[0],"File");\r
- SequenceI[] sequences = new AppletFormatAdapter().readFile(args[0], "File", format);\r
-\r
+ SequenceI[] sequences = null;\r
+ try{\r
+ sequences = new AppletFormatAdapter().readFile(args[0], "File", format);\r
+ }catch(java.io.IOException ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
if ( (sequences != null) && (sequences.length > 0))\r
{\r
AlignFrame af = new AlignFrame(new Alignment(sequences), null, args[0]);\r
public void run()\r
{\r
SequenceI[] sequences = null;\r
- sequences = new AppletFormatAdapter().readFile(file, protocol, format);\r
-\r
+ try{\r
+ sequences = new AppletFormatAdapter().readFile(file, protocol,\r
+ format);\r
+ }catch(java.io.IOException ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
if ((sequences != null) && (sequences.length > 0))\r
{\r
currentAlignFrame = new AlignFrame(new Alignment(sequences),\r
if (treeFile != null)\r
{\r
if (treeFile.indexOf("://") == -1)\r
- treeFile = getCodeBase() + treeFile;\r
+ treeFile = getCodeBase() + treeFile;\r
\r
try\r
{\r
- jalview.io.NewickFile fin = new jalview.io.NewickFile(applet.\r
- getCodeBase() + treeFile, "URL");\r
+ jalview.io.NewickFile fin = new jalview.io.NewickFile(treeFile, "URL");\r
fin.parse();\r
\r
if (fin.getTree() != null)\r
TreePanel tp = null;\r
tp = new TreePanel(currentAlignFrame.viewport,\r
currentAlignFrame.viewport.getAlignment().getSequences(),\r
- fin, "FromFile", applet.getCodeBase() + treeFile);\r
+ fin, "FromFile", treeFile);\r
addFrame(tp, treeFile, 600, 500);\r
currentAlignFrame.addTreeMenuItem(tp, treeFile);\r
}\r
\r
if (FormatAdapter.formats.contains(format))\r
{\r
+ try{\r
sequences = new FormatAdapter().readFile(getText(), "Paste", format);\r
+ }catch(java.io.IOException ex)\r
+ {\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+ "Couldn't read the pasted text.\n" +ex.toString(),\r
+ "Error parsing text",\r
+ JOptionPane.WARNING_MESSAGE);\r
+ }\r
}\r
\r
if (sequences != null)\r
{\r
}\r
}\r
- else\r
- {\r
- JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
- "Couldn't read the pasted text.\n" +\r
- "Formats currently supported are\n" +\r
- "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM",\r
- "Error parsing text", JOptionPane.WARNING_MESSAGE);\r
- }\r
}\r
\r
/**\r
public void run()\r
{\r
String str = textfield.getText();\r
- SequenceI[] sequences = new FormatAdapter().readFile(str, "Paste", "FASTA");\r
+ SequenceI[] sequences = null;\r
+ try{new FormatAdapter().readFile(str, "Paste", "FASTA");}\r
+ catch(Exception ex){}\r
if(sequences!=null && sequences.length>0)\r
{\r
str = jalview.analysis.AlignSeq.extractGaps(\r