From: Jim Procter Date: Thu, 17 Oct 2013 11:33:32 +0000 (+0100) Subject: fix for JAL-1398 - original colourscheme is enabled if colourscheme has a BaseColour... X-Git-Tag: Jalview_2_9~218^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c9fd7ec6f8096c6659cccfc0aad0c2d5fd9ed9d1;hp=3b4eda86f1f240a932cc778658dc1fbe56e9630d;p=jalview.git fix for JAL-1398 - original colourscheme is enabled if colourscheme has a BaseColour setting. See JAL-1399 for future improvements. --- diff --git a/src/jalview/appletgui/AnnotationColourChooser.java b/src/jalview/appletgui/AnnotationColourChooser.java index f9594eb..3c0f704 100644 --- a/src/jalview/appletgui/AnnotationColourChooser.java +++ b/src/jalview/appletgui/AnnotationColourChooser.java @@ -81,18 +81,19 @@ public class AnnotationColourChooser extends Panel implements setDefaultMinMax(); + adjusting = true; if (oldcs instanceof AnnotationColourGradient) { AnnotationColourGradient acg = (AnnotationColourGradient) oldcs; - currentColours.setState(acg.isPredefinedColours()); - if (!acg.isPredefinedColours()) + currentColours.setState(acg.isPredefinedColours() || acg.getBaseColour()!=null); + if (!acg.isPredefinedColours() && acg.getBaseColour()==null) { minColour.setBackground(acg.getMinColour()); maxColour.setBackground(acg.getMaxColour()); } + // seqAssociated.setState(acg.isSeqAssociated()); } - adjusting = true; Vector list = new Vector(); int index = 1; @@ -492,6 +493,7 @@ public class AnnotationColourChooser extends Panel implements } // update colours in linked windows + ap.alignmentChanged(); ap.paintAlignment(true); } diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 3278a76..5ee69f2 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -120,18 +120,19 @@ public class AnnotationColourChooser extends JPanel // Always get default shading from preferences. setDefaultMinMax(); + adjusting = true; if (oldcs instanceof AnnotationColourGradient) { AnnotationColourGradient acg = (AnnotationColourGradient) oldcs; - currentColours.setSelected(acg.isPredefinedColours()); - if (!acg.isPredefinedColours()) + currentColours.setSelected(acg.isPredefinedColours() || acg.getBaseColour()!=null); + if (!acg.isPredefinedColours() && acg.getBaseColour()==null) { minColour.setBackground(acg.getMinColour()); maxColour.setBackground(acg.getMaxColour()); } seqAssociated.setSelected(acg.isSeqAssociated()); + } - adjusting = true; annotations = new JComboBox( getAnnotationItems(seqAssociated.isSelected()));