X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceGroup.java;h=752c6d4335dca76cc37d0b3e04449ca958d94fe9;hb=b5d61763044c1d72f06ce0e50da2171422a3774b;hp=17348c2cf08763271f3bf1fc3300e8293f209fbb;hpb=76d3286a73053be49a8cfd6842fffba4db111e08;p=jalview.git diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 17348c2..752c6d4 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -178,7 +178,9 @@ public class SequenceGroup implements AnnotatedCollectionI endRes = seqsel.endRes; cs = seqsel.cs; if (seqsel.description != null) + { description = new String(seqsel.description); + } hidecols = seqsel.hidecols; hidereps = seqsel.hidereps; idColour = seqsel.idColour; @@ -238,7 +240,9 @@ public class SequenceGroup implements AnnotatedCollectionI } } if (!found) + { continue; + } } AlignmentAnnotation newannot = new AlignmentAnnotation( seq.getAnnotation()[a]); @@ -1261,6 +1265,29 @@ public class SequenceGroup implements AnnotatedCollectionI } /** + * Returns a list of annotations that match the specified sequenceRef, calcId + * and label, ignoring null values. + * + * @return list of AlignmentAnnotation objects + */ + @Override + public Iterable findAnnotations(SequenceI seq, + String calcId, String label) + { + ArrayList aa = new ArrayList(); + for (AlignmentAnnotation ann : getAlignmentAnnotation()) + { + if (ann.getCalcId() != null && ann.getCalcId().equals(calcId) + && ann.sequenceRef != null && ann.sequenceRef == seq + && ann.label != null && ann.label.equals(label)) + { + aa.add(ann); + } + } + return aa; + } + + /** * Answer true if any annotation matches the calcId passed in (if not null). * * @param calcId