omitHidden = ap.av.getViewAsString(true);
Alignment oal = new Alignment(ap.av.getSequenceSelection());
AlignmentAnnotation[] nala = ap.av.alignment.getAlignmentAnnotation();
- for (int i = 0; i < nala.length; i++)
- {
- AlignmentAnnotation na = nala[i];
- oal.addAnnotation(na);
+ if (nala!=null) {
+ for (int i = 0; i < nala.length; i++)
+ {
+ AlignmentAnnotation na = nala[i];
+ oal.addAnnotation(na);
+ }
}
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
oal, omitHidden, csel, sg));
Alignment alv = new Alignment(replaceStrings(alignment
.getSequencesArray(), omitHidden));
AlignmentAnnotation[] ala = alignment.getAlignmentAnnotation();
- for (int i = 0; i < ala.length; i++)
+ if (ala != null)
{
- AlignmentAnnotation na = new AlignmentAnnotation(ala[i]);
- if (selgp != null)
+ for (int i = 0; i < ala.length; i++)
{
- colSel.makeVisibleAnnotation(selgp.getStartRes(), selgp
- .getEndRes(), na);
+ AlignmentAnnotation na = new AlignmentAnnotation(ala[i]);
+ if (selgp != null)
+ {
+ colSel.makeVisibleAnnotation(selgp.getStartRes(), selgp
+ .getEndRes(), na);
+ }
+ else
+ {
+ colSel.makeVisibleAnnotation(na);
+ }
+ alv.addAnnotation(na);
}
- else
- {
- colSel.makeVisibleAnnotation(na);
- }
- alv.addAnnotation(na);
}
return this.formatSequences(format, alv, suffix);
}