fix for JAL-1398 - original colourscheme is enabled if colourscheme has a BaseColour...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 17 Oct 2013 11:33:32 +0000 (12:33 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 17 Oct 2013 11:33:32 +0000 (12:33 +0100)
See JAL-1399 for future improvements.

src/jalview/appletgui/AnnotationColourChooser.java
src/jalview/gui/AnnotationColourChooser.java

index f9594eb..3c0f704 100644 (file)
@@ -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);
   }
 
index 3278a76..5ee69f2 100644 (file)
@@ -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()));