From: amwaterhouse Date: Thu, 11 May 2006 14:06:16 +0000 (+0000) Subject: Maintain numbering if remove left is undone X-Git-Tag: Release_2_1~422 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5e7f56e027b1fa1846cbd6589c7f11af1f983a40;p=jalview.git Maintain numbering if remove left is undone --- diff --git a/src/jalview/datamodel/HistoryItem.java b/src/jalview/datamodel/HistoryItem.java index 0520bc0..09e87f3 100755 --- a/src/jalview/datamodel/HistoryItem.java +++ b/src/jalview/datamodel/HistoryItem.java @@ -75,7 +75,9 @@ public class HistoryItem SequenceI seq = al.getSequenceAt(i); sequences.addElement(seq); alignIndex.addElement(i + ""); - seqAsString.addElement(seq.getSequence().toString()); + seqAsString.addElement(seq.getStart() + +" "+seq.getEnd() + +" "+seq.getSequence().toString()); } if(alignment.getHiddenSequences()!=null @@ -115,22 +117,23 @@ public class HistoryItem } else { - + StringTokenizer st; for (int i = 0; i < sequences.size(); i++) { SequenceI restore = (SequenceI) sequences.elementAt(i); + if (restore.getLength() == 0) { //This is for edits which remove all residues in a sequence - restore.setSequence(seqAsString.elementAt(i).toString()); alignment.getSequences().insertElementAt(restore, Integer.parseInt(alignIndex.elementAt(i).toString())); } - else - { - restore.setSequence(seqAsString.elementAt(i).toString()); - } + + st = new StringTokenizer(seqAsString.elementAt(i).toString()); + restore.setStart(Integer.parseInt(st.nextToken())); + restore.setEnd(Integer.parseInt(st.nextToken())); + restore.setSequence(st.nextToken()); } if(hiddenSeqs!=null)