public boolean readAnnotationFile(AlignmentI al, String file,\r
String protocol)\r
{\r
- String groupRef = null;\r
- Hashtable groupRefRows = new Hashtable();\r
-\r
- Hashtable autoAnnots = new Hashtable();\r
+ BufferedReader in = null;\r
try\r
{\r
- BufferedReader in = null;\r
if (protocol.equals(AppletFormatAdapter.FILE))\r
{\r
in = new BufferedReader(new FileReader(file));\r
in = new BufferedReader(new java.io.InputStreamReader(is));\r
}\r
}\r
+ if (in != null)\r
+ {\r
+ return parseAnnotationFrom(al, in);\r
+ }\r
\r
+ } catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ System.out.println("Problem reading annotation file: " + ex);\r
+ return false;\r
+ }\r
+ return false;\r
+ }\r
+\r
+ public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in)\r
+ throws Exception\r
+ {\r
+ String groupRef = null;\r
+ Hashtable groupRefRows = new Hashtable();\r
+\r
+ Hashtable autoAnnots = new Hashtable();\r
+ {\r
String line, label, description, token;\r
int graphStyle, index;\r
int refSeqIndex = 1;\r
}\r
((Vector) groupRefRows.get(groupRef)).removeAllElements();\r
}\r
- } catch (Exception ex)\r
- {\r
- ex.printStackTrace();\r
- System.out.println("Problem reading annotation file: " + ex);\r
- return false;\r
}\r
return true;\r
}\r