From be545261cf6e7225da6f3ac1306b1b2609fd0e70 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Mar 2006 15:31:36 +0000 Subject: [PATCH] historyItem.restore --- src/jalview/gui/AlignFrame.java | 42 +++++---------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index b714aea..a4f5e4d 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -450,42 +450,8 @@ public class AlignFrame // used by undo and redo void restoreHistoryItem(HistoryItem hi) { - if (hi.getType() == HistoryItem.SORT) - { - for (int i = 0; i < hi.getSequences().size(); i++) - { - viewport.alignment.getSequences().setElementAt(hi.getSequences() - .elementAt(i), - i); - } - } - else - { - for (int i = 0; i < hi.getSequences().size(); i++) - { - SequenceI restore = (SequenceI) hi.getSequences().elementAt(i); - if (restore.getLength() == 0) - { - restore.setSequence(hi.getHidden().elementAt(i).toString()); - viewport.alignment.getSequences().insertElementAt(restore, - hi.getAlignIndex(i)); - } - else - { - restore.setSequence(hi.getHidden().elementAt(i).toString()); - } - } - - if (hi.getType() == HistoryItem.PASTE) - { - for (int i = viewport.alignment.getHeight() - 1; - i > (hi.getSequences().size() - 1); i--) - { - viewport.alignment.deleteSequence(i); - } - } - } + hi.restore(); updateEditMenuBar(); @@ -2575,11 +2541,12 @@ public void showTranslation_actionPerformed(ActionEvent e) */ public boolean parseGroupsFile(String file) { + String line = null; try { BufferedReader in = new BufferedReader(new FileReader(file)); SequenceI seq = null; - String line, type, desc, token; + String type, desc, token; int index, start, end; StringTokenizer st; @@ -2650,8 +2617,9 @@ public boolean parseGroupsFile(String file) } catch (Exception ex) { + System.out.println(line); ex.printStackTrace(); - System.out.println("Error parsing groups file: " + ex); + System.out.println("Error parsing groups file: " + ex +"\n"+line); return false; } -- 1.7.10.2