}
int alwidth = 0;
+ ArrayList<Integer> newGraphGroups=new ArrayList<Integer>();
+ int fgroup=-1;
if (newAlignment)
{
{
newDs.clear(); // tidy up
}
+ if (alignment.getAlignmentAnnotation()!=null)
+ {
+ for (AlignmentAnnotation alan:alignment.getAlignmentAnnotation())
+ {
+ if (alan.graphGroup>fgroup)
+ {
+ fgroup=alan.graphGroup;
+ }
+ }
+ }
if (pastedal.getAlignmentAnnotation() != null)
{
// Add any annotation attached to alignment.
if (alann[i].sequenceRef == null && !alann[i].autoCalculated)
{
AlignmentAnnotation newann = new AlignmentAnnotation(alann[i]);
+ if (newann.graphGroup>-1)
+ {
+ if (newGraphGroups.size()<=newann.graphGroup || newGraphGroups.get(newann.graphGroup)==null)
+ {
+ for (int q=newGraphGroups.size();q<=newann.graphGroup; q++)
+ {
+ newGraphGroups.add(q, null);
+ }
+ newGraphGroups.set(newann.graphGroup,new Integer(++fgroup));
+ }
+ newann.graphGroup = newGraphGroups.get(newann.graphGroup).intValue();
+ }
+
newann.padAnnotation(alwidth);
alignment.addAnnotation(newann);
}
{
if (sequences[i].getAnnotation() != null)
{
+ AlignmentAnnotation newann;
for (int a = 0; a < sequences[i].getAnnotation().length; a++)
{
annotationAdded = true;
- sequences[i].getAnnotation()[a].adjustForAlignment();
- sequences[i].getAnnotation()[a].padAnnotation(alwidth);
+ newann=sequences[i].getAnnotation()[a];
+ newann.adjustForAlignment();
+ newann.padAnnotation(alwidth);
+ if (newann.graphGroup>-1)
+ {
+ if (newann.graphGroup>-1)
+ {
+ if (newGraphGroups.size()<=newann.graphGroup || newGraphGroups.get(newann.graphGroup)==null)
+ {
+ for (int q=newGraphGroups.size();q<=newann.graphGroup; q++)
+ {
+ newGraphGroups.add(q, null);
+ }
+ newGraphGroups.set(newann.graphGroup,new Integer(++fgroup));
+ }
+ newann.graphGroup = newGraphGroups.get(newann.graphGroup).intValue();
+ }
+ }
alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation
// was
// duplicated
newann.padAnnotation(avwidth);
alview[avnum].addAnnotation(newann); // annotation was
// duplicated earlier
+ // TODO JAL-1145 graphGroups are not updated for sequence annotation added to several views. This may cause strangeness
alview[avnum].setAnnotationIndex(newann, a);
}
}