From a5ef4fc9d498934033e294ce80ddfe6486a41518 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 5 Apr 2016 18:32:07 +0100 Subject: [PATCH] JAL-2046 add/delete SequenceFeature operate on dataset if one is defined --- src/jalview/datamodel/Sequence.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- 1.7.10.2