From: amwaterhouse Date: Fri, 4 May 2007 10:31:18 +0000 (+0000) Subject: Annotations do not extend when full alignment is adjusted X-Git-Tag: Release_2_3~66 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d7e33557512a6e6c3c604aeb6ff67c023ee5c251;p=jalview.git Annotations do not extend when full alignment is adjusted --- diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index aece057..61e2595 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -112,7 +112,7 @@ public class EditCommand /** * append a new editCommand * Note. this shouldn't be called if the edit is an operation affects more alignment objects than the one referenced - * in al (for example, cut or pasting whole sequences). Use the form with an additional AlignmentI[] views parameter. + * in al (for example, cut or pasting whole sequences). Use the form with an additional AlignmentI[] views parameter. * @param command * @param seqs * @param position @@ -232,6 +232,7 @@ public class EditCommand final void insertGap(Edit command) { + for (int s = 0; s < command.seqs.length; s++) { command.seqs[s].insertCharAt(command.position, @@ -403,7 +404,6 @@ public class EditCommand final void adjustAnnotations(Edit command, boolean insert, boolean modifyVisibility, AlignmentI[] views) { - AlignmentAnnotation[] annotations = null; if (modifyVisibility && !insert) @@ -440,7 +440,7 @@ public class EditCommand } command.seqs[s].setAlignmentAnnotation(null); if (alen!=tmp.length) - { + { // save the non-null annotation references only AlignmentAnnotation[] saved = new AlignmentAnnotation[alen]; for (int aa=0,aapos=0;aa aSize) + if (command.position + command.number >= aSize) { tSize = aSize; } else { - tSize = aSize - command.number + command.position; + tSize = aSize - command.number; } } else @@ -603,9 +599,9 @@ public class EditCommand tSize = aSize; } temp = new Annotation[tSize]; - } + if (insert) { if (command.position < annotations[a].annotations.length)