JAL-1397 getters for originalColours flag
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 17 Oct 2013 10:06:50 +0000 (11:06 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Thu, 17 Oct 2013 10:07:48 +0000 (11:07 +0100)
src/jalview/appletgui/AnnotationColourChooser.java
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/PopupMenu.java
src/jalview/schemes/AnnotationColourGradient.java

index 5f61ead..c9e9ee4 100644 (file)
@@ -84,8 +84,8 @@ public class AnnotationColourChooser extends Panel implements
     if (oldcs instanceof AnnotationColourGradient)
     {
       AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
-      currentColours.setState(acg.predefinedColours);
-      if (!acg.predefinedColours)
+      currentColours.setState(acg.isPredefinedColours());
+      if (!acg.isPredefinedColours())
       {
         minColour.setBackground(acg.getMinColour());
         maxColour.setBackground(acg.getMaxColour());
@@ -458,7 +458,7 @@ public class AnnotationColourChooser extends Panel implements
     if (currentAnnotation.graphMin == 0f
             && currentAnnotation.graphMax == 0f)
     {
-      acg.predefinedColours = true;
+      acg.setPredefinedColours(true);
     }
 
     acg.thresholdIsMinMax = thresholdIsMin.getState();
index 61ef75f..3278a76 100644 (file)
@@ -123,8 +123,8 @@ public class AnnotationColourChooser extends JPanel
     if (oldcs instanceof AnnotationColourGradient)
     {
       AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
-      currentColours.setSelected(acg.predefinedColours);
-      if (!acg.predefinedColours)
+      currentColours.setSelected(acg.isPredefinedColours());
+      if (!acg.isPredefinedColours())
       {
         minColour.setBackground(acg.getMinColour());
         maxColour.setBackground(acg.getMaxColour());
@@ -550,7 +550,7 @@ public class AnnotationColourChooser extends JPanel
     if (currentAnnotation.graphMin == 0f
             && currentAnnotation.graphMax == 0f)
     {
-      acg.predefinedColours = true;
+      acg.setPredefinedColours(true);
     }
 
     acg.thresholdIsMinMax = thresholdIsMin.isSelected();
index 29370ac..3bc7c5c 100644 (file)
@@ -1642,7 +1642,7 @@ public class PopupMenu extends JPopupMenu
             sequence.getAnnotation()[0], null,
             AnnotationColourGradient.NO_THRESHOLD);
 
-    acg.predefinedColours = true;
+    acg.setPredefinedColours(true);
     sg.cs = acg;
 
     refresh();
index 729065c..17af427 100755 (executable)
@@ -47,9 +47,9 @@ public class AnnotationColourGradient extends ResidueColourScheme
 
   ColourSchemeI colourScheme;
 
-  public boolean predefinedColours = false;
+  private boolean predefinedColours = false;
 
-  public boolean seqAssociated = false;
+  private boolean seqAssociated = false;
 
   IdentityHashMap<SequenceI, AlignmentAnnotation> seqannot = null;
 
@@ -270,6 +270,16 @@ public class AnnotationColourGradient extends ResidueColourScheme
     return currentColour;
   }
 
+  public boolean isPredefinedColours()
+  {
+    return predefinedColours;
+  }
+
+  public void setPredefinedColours(boolean predefinedColours)
+  {
+    this.predefinedColours = predefinedColours;
+  }
+
   public boolean isSeqAssociated()
   {
     return seqAssociated;