From: amwaterhouse Date: Thu, 16 Mar 2006 15:31:36 +0000 (+0000) Subject: historyItem.restore X-Git-Tag: Root_VamJalview_2_07b+~35 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=be545261cf6e7225da6f3ac1306b1b2609fd0e70;p=jalview.git historyItem.restore --- 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; }