JAL-3148 correct features on/off structure when Colour by Sequence
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 6 Nov 2018 16:48:46 +0000 (16:48 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 6 Nov 2018 16:48:46 +0000 (16:48 +0000)
src/jalview/structures/models/AAStructureBindingModel.java

index 0b19d51..a53674f 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.structures.models;
 
+import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.api.SequenceRendererI;
 import jalview.api.StructureSelectionManagerProvider;
@@ -46,8 +47,6 @@ import java.util.Arrays;
 import java.util.BitSet;
 import java.util.List;
 
-import org.springframework.web.filter.ShallowEtagHeaderFilter;
-
 /**
  * 
  * A base class to hold common function for protein structure model binding.
@@ -857,6 +856,8 @@ public abstract class AAStructureBindingModel
   public void colourBySequence(AlignmentViewPanel alignmentv, SequenceRendererI sr, boolean showFeats)
   {
     showFeatures = showFeats;
+    colourBy = ColourBy.Sequence;
+    
     if (!isLoadingFinished())
     {
       return;
@@ -900,21 +901,24 @@ public void updateColours(Object source) {
     {
       return;
     }
-    if (!showFeatures && (colourScheme == null || colourScheme.isSimple()))
+    if (!isColourBySequence() && !showFeatures && 
+            (colourScheme == null || colourScheme.isSimple()))
     {
       return;
     }
     
     if (!isLoadingFromArchive())
     {
+      AlignViewportI av = ap.getAlignViewport();
       if (isColourBySequence())
       {
-        colourBySequence(ap, new SequenceRenderer(ap.getAlignViewport()), 
+        showFeatures = av.isShowSequenceFeatures();
+        colourBySequence(ap, new SequenceRenderer(av), 
                 showFeatures);
       } 
       else
       {
-        colourBySequence(ap, new SequenceRenderer(ap.getAlignViewport(), 
+        colourBySequence(ap, new SequenceRenderer(av, 
                 colourScheme), showFeatures);
       }
     }