From e5ecde79316259cf913da454373e9f5ee7488798 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 17 Oct 2013 11:06:50 +0100 Subject: [PATCH] JAL-1397 getters for originalColours flag --- src/jalview/appletgui/AnnotationColourChooser.java | 6 +++--- src/jalview/gui/AnnotationColourChooser.java | 6 +++--- src/jalview/gui/PopupMenu.java | 2 +- src/jalview/schemes/AnnotationColourGradient.java | 14 ++++++++++++-- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/jalview/appletgui/AnnotationColourChooser.java b/src/jalview/appletgui/AnnotationColourChooser.java index 5f61ead..c9e9ee4 100644 --- a/src/jalview/appletgui/AnnotationColourChooser.java +++ b/src/jalview/appletgui/AnnotationColourChooser.java @@ -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(); diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 61ef75f..3278a76 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -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(); diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 29370ac..3bc7c5c 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -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(); diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index 729065c..17af427 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -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 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; -- 1.7.10.2