+ 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++)
+ {
+ if (tmp[aa] != null)
+ {
+ saved[aapos++] = tmp[aa];
+ tmp[aa] = null;
+ }
+ }
+ tmp = saved;
+ command.deletedAnnotationRows.put(command.seqs[s], saved);
+ // and then remove any annotation in the other views
+ for (int alview = 0; views != null && alview < views.length; alview++)
+ {
+ if (views[alview] != command.al)
+ {
+ AlignmentAnnotation[] toremove = views[alview]
+ .getAlignmentAnnotation();
+ if (toremove == null || toremove.length == 0)
+ {
+ continue;
+ }
+ // remove any alignment annotation on this sequence that's
+ // on that alignment view.
+ for (int aa = 0; aa < toremove.length; aa++)
+ {
+ if (toremove[aa].sequenceRef == command.seqs[s])
+ {
+ views[alview].deleteAnnotation(toremove[aa]);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ // save all the annotation
+ command.deletedAnnotationRows.put(command.seqs[s], tmp);
+ }