JAL-2724 patch to fix ClassCastException - method should be refactored and tests...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 6 Sep 2017 10:55:57 +0000 (11:55 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 6 Sep 2017 10:55:57 +0000 (11:55 +0100)
src/jalview/gui/AnnotationColourChooser.java

index f088791..8d123bb 100644 (file)
@@ -456,22 +456,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter
         {
           continue;
         }
-
-        if (useOriginalColours.isSelected())
-        {
-          sg.setColourScheme(new AnnotationColourGradient(currentAnn,
-                  sg.getColourScheme(), selectedThresholdOption));
-          ((AnnotationColourGradient) sg.cs)
-                  .setSeqAssociated(seqAssociated.isSelected());
-        }
-        else
-        {
-          sg.setColourScheme(new AnnotationColourGradient(currentAnn,
-                  minColour.getBackground(), maxColour.getBackground(),
-                  selectedThresholdOption));
-          ((AnnotationColourGradient) sg.cs)
-                  .setSeqAssociated(seqAssociated.isSelected());
-        }
+        sg.setColourScheme(
+                acg.getInstance(sg, ap.av.getHiddenRepSequences()));
       }
     }
     return false;