/**
* 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
final void insertGap(Edit command)
{
+
for (int s = 0; s < command.seqs.length; s++)
{
command.seqs[s].insertCharAt(command.position,
final void adjustAnnotations(Edit command, boolean insert, boolean modifyVisibility, AlignmentI[] views)
{
-
AlignmentAnnotation[] annotations = null;
if (modifyVisibility && !insert)
}
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<tmp.length;aa++)
Annotation[] temp;
for (int a = 0; a < annotations.length; a++)
{
- if (annotations[a].autoCalculated)
+ if (annotations[a].autoCalculated || annotations[a].annotations == null)
{
continue;
}
int tSize = 0;
- if (annotations[a].annotations == null)
- {
- // nothing to edit here ?
- continue;
- }
+
aSize = annotations[a].annotations.length;
if (insert)
{
{
if (command.position < aSize)
{
- if (command.position + command.number > aSize)
+ if (command.position + command.number >= aSize)
{
tSize = aSize;
}
else
{
- tSize = aSize - command.number + command.position;
+ tSize = aSize - command.number;
}
}
else
tSize = aSize;
}
temp = new Annotation[tSize];
-
}
+
if (insert)
{
if (command.position < annotations[a].annotations.length)