From: Jim Procter Date: Tue, 5 Apr 2016 17:32:07 +0000 (+0100) Subject: JAL-2046 add/delete SequenceFeature operate on dataset if one is defined X-Git-Tag: Release_2_10_0~249^2~31^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a5ef4fc9d498934033e294ce80ddfe6486a41518;p=jalview.git JAL-2046 add/delete SequenceFeature operate on dataset if one is defined --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 5bfdb04..a61f093 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -312,7 +312,11 @@ public class Sequence extends ASequence implements SequenceI @Override public synchronized void addSequenceFeature(SequenceFeature sf) { - // TODO add to dataset sequence instead if there is one? + if (sequenceFeatures==null && datasetSequence != null) + { + datasetSequence.addSequenceFeature(sf); + return; + } if (sequenceFeatures == null) { sequenceFeatures = new SequenceFeature[0]; @@ -338,6 +342,9 @@ public class Sequence extends ASequence implements SequenceI { if (sequenceFeatures == null) { + if (datasetSequence!=null) { + datasetSequence.deleteFeature(sf); + } return; }