spike branch updated from latest features/JAL-2446
[jalview.git] / src / jalview / appletgui / FeatureRenderer.java
index 435e78d..8721ff4 100644 (file)
@@ -413,7 +413,8 @@ public class FeatureRenderer extends
         if (!colourPanel.isGcol)
         {
           // update colour - otherwise its already done.
-          setColour(sf.type, new FeatureColour(colourPanel.getBackground()));
+          setColour(enteredType,
+                  new FeatureColour(colourPanel.getBackground()));
         }
         int newBegin = sf.begin;
         int newEnd = sf.end;
@@ -431,14 +432,14 @@ public class FeatureRenderer extends
          * (to ensure integrity of SequenceFeatures data store)
          */
         sequences.get(0).deleteFeature(sf);
-        SequenceFeature newSf = new SequenceFeature(sf, newBegin, newEnd,
-                enteredGroup, sf.getScore());
+        SequenceFeature newSf = new SequenceFeature(sf, enteredType,
+                newBegin, newEnd, enteredGroup, sf.getScore());
         newSf.setDescription(enteredDesc);
         ffile.parseDescriptionHTML(newSf, false);
         // amend features dialog only updates one sequence at a time
         sequences.get(0).addSequenceFeature(newSf);
-        boolean typeOrGroupChanged = (!featureType.equals(sf.type) || !featureGroup
-                .equals(sf.featureGroup));
+        boolean typeOrGroupChanged = (!featureType.equals(newSf.getType()) || !featureGroup
+                .equals(newSf.getFeatureGroup()));
 
         ffile.parseDescriptionHTML(sf, false);
         if (typeOrGroupChanged)