X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=271374ff0dc2380c4e8165642514fe6605e0f96d;hb=0d6fdcd9c4597475c09fd96da43ddcadccf78fa1;hp=6c119364fb62b9b77b531696e54f9a54e718960c;hpb=f52f7b378972cc884b5d3e5cc250f89667f558f7;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 6c11936..271374f 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1381,12 +1381,14 @@ public class Alignment implements AlignmentI @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; @@ -1395,7 +1397,7 @@ public class Alignment implements AlignmentI 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) {