// used by undo and redo\r
void restoreHistoryItem(HistoryItem hi)\r
{\r
- if (hi.getType() == HistoryItem.SORT)\r
- {\r
- for (int i = 0; i < hi.getSequences().size(); i++)\r
- {\r
- viewport.alignment.getSequences().setElementAt(hi.getSequences()\r
- .elementAt(i),\r
- i);\r
- }\r
- }\r
- else\r
- {\r
- for (int i = 0; i < hi.getSequences().size(); i++)\r
- {\r
- SequenceI restore = (SequenceI) hi.getSequences().elementAt(i);\r
\r
- if (restore.getLength() == 0)\r
- {\r
- restore.setSequence(hi.getHidden().elementAt(i).toString());\r
- viewport.alignment.getSequences().insertElementAt(restore,\r
- hi.getAlignIndex(i));\r
- }\r
- else\r
- {\r
- restore.setSequence(hi.getHidden().elementAt(i).toString());\r
- }\r
- }\r
-\r
- if (hi.getType() == HistoryItem.PASTE)\r
- {\r
- for (int i = viewport.alignment.getHeight() - 1;\r
- i > (hi.getSequences().size() - 1); i--)\r
- {\r
- viewport.alignment.deleteSequence(i);\r
- }\r
- }\r
- }\r
+ hi.restore();\r
\r
updateEditMenuBar();\r
\r
*/\r
public boolean parseGroupsFile(String file)\r
{\r
+ String line = null;\r
try\r
{\r
BufferedReader in = new BufferedReader(new FileReader(file));\r
SequenceI seq = null;\r
- String line, type, desc, token;\r
+ String type, desc, token;\r
\r
int index, start, end;\r
StringTokenizer st;\r
}\r
catch (Exception ex)\r
{\r
+ System.out.println(line);\r
ex.printStackTrace();\r
- System.out.println("Error parsing groups file: " + ex);\r
+ System.out.println("Error parsing groups file: " + ex +"\n"+line);\r
return false;\r
}\r
\r