X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSequenceGroup.java;h=a01c0a5ef67be699bbc0c6926397431aac31c7dc;hb=8134bbf710c92115deebb3649ecd21b5cb620ec7;hp=521bdbedb7cfa4ce33834eac54440785b1cb2880;hpb=279af6f3b1803de7a1e467b83a7205df18e70d48;p=jalview.git diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 521bdbe..a01c0a5 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. @@ -500,10 +500,6 @@ public class SequenceGroup implements AnnotatedCollectionI { return; } - if (cs != null) - { - cs.alignmentChanged(this, null); - } try { Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, @@ -515,7 +511,6 @@ public class SequenceGroup implements AnnotatedCollectionI if (cs != null) { cs.setConsensus(cnsns); - cs.alignmentChanged(this, null); } if ((conservation != null) @@ -535,10 +530,13 @@ public class SequenceGroup implements AnnotatedCollectionI if (cs.conservationApplied()) { cs.setConservation(c); - cs.alignmentChanged(this, null); } } } + if (cs != null) + { + cs.alignmentChanged(context!=null ? context : this, null); + } } catch (java.lang.OutOfMemoryError err) { // TODO: catch OOM @@ -1211,11 +1209,15 @@ public class SequenceGroup implements AnnotatedCollectionI ArrayList annot = new ArrayList(); for (SequenceI seq : (Vector) sequences) { - for (AlignmentAnnotation al : seq.getAnnotation()) + AlignmentAnnotation[] aa = seq.getAnnotation(); + if (aa != null) { - if (al.groupRef == this) + for (AlignmentAnnotation al : aa) { - annot.add(al); + if (al.groupRef == this) + { + annot.add(al); + } } } } @@ -1248,4 +1250,21 @@ public class SequenceGroup implements AnnotatedCollectionI { sequences.clear(); } + private AnnotatedCollectionI context; + /** + * set the alignment or group context for this group + * @param context + */ + public void setContext(AnnotatedCollectionI context) + { + this.context = context; + } + /* (non-Javadoc) + * @see jalview.datamodel.AnnotatedCollectionI#getContext() + */ + @Override + public AnnotatedCollectionI getContext() + { + return context; + } }