@Override
public AlignmentAnnotation findOrCreateAnnotation(String name,
- boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef)
+ String calcId, boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef)
{
+ assert(name!=null);
for (AlignmentAnnotation annot : getAlignmentAnnotation())
{
if (annot.autoCalculated == autoCalc
- && annot.getCalcId().equals(name)
+ && (name.equals(annot.label))
+ && (calcId==null || annot.getCalcId().equals(calcId))
&& 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.setCalcId(new String(calcId));
annot.autoCalculated = autoCalc;
if (seqRef != null)
{