}
}
+ @Override
+ public AlignmentAnnotation findOrCreateAnnotation(String name, boolean autoCalc,
+ SequenceI seqRef, SequenceGroup groupRef)
+ {
+ for (AlignmentAnnotation annot :
+ getAlignmentAnnotation())
+ {
+ if (annot.autoCalculated == autoCalc
+ && annot.getCalcId().equals(name)
+ && annot.sequenceRef == seqRef && annot.groupRef == groupRef)
+ {
+ return annot;
+ }
+ }
+ AlignmentAnnotation annot = new AlignmentAnnotation(name, name,
+ new Annotation[1], 0f, 0f, AlignmentAnnotation.BAR_GRAPH);
+ annot.hasText = false;
+ annot.setCalcId(new String(name));
+ annot.autoCalculated = autoCalc;
+ if (seqRef != null)
+ {
+ annot.setSequenceRef(seqRef);
+ }
+ annot.groupRef = groupRef;
+ addAnnotation(annot);
+
+ return annot;
+ }
+
+ @Override
+ public Iterable<AlignmentAnnotation> findAnnotation(String calcId)
+ {
+ ArrayList<AlignmentAnnotation> aa=new ArrayList<AlignmentAnnotation>();
+ for (AlignmentAnnotation a:getAlignmentAnnotation())
+ {
+ if (a.getCalcId()==calcId || (a.getCalcId()!=null && calcId!=null && a.getCalcId().equals(calcId)))
+ {
+ aa.add(a);
+ }
+ }
+ return aa;
+ }
+
}