From: gmungoc Date: Tue, 8 Jan 2019 10:56:22 +0000 (+0000) Subject: JAL-3183 overwrite 'no colour' group colours X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-3183groupColourOverwritten;p=jalview.git JAL-3183 overwrite 'no colour' group colours --- diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 384635b..710ec2e 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -444,17 +444,21 @@ public class AnnotationColourChooser extends AnnotationRowFilter av.setGlobalColourScheme(acg); - if (av.getAlignment().getGroups() != null) + /* + * set this colour scheme on groups that have no colour scheme configured; + * note we can skip this if 'apply to all groups' is selected, + * as it will have been done by av.setGlobalColourScheme + */ + if (!av.getColourAppliesToAllGroups() + && av.getAlignment().getGroups() != null) { - for (SequenceGroup sg : ap.av.getAlignment().getGroups()) { - if (sg.cs == null) + if (sg.getColourScheme() == null) { - continue; + sg.setColourScheme( + acg.getInstance(sg, ap.av.getHiddenRepSequences())); } - sg.setColourScheme( - acg.getInstance(sg, ap.av.getHiddenRepSequences())); } } }