X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationColourChooser.java;h=25e08b046099ee9e09236a0163a9b08f398e9f35;hb=7dd9c4874042f584dc1feb6a345fe929a8509e2b;hp=41c20bdd90ff48e49f327bbf0dca9da0071e8cdc;hpb=8a6fa9ea9900d0f106529c3f6283e7f9d76dd2cb;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationColourChooser.java b/src/jalview/appletgui/AnnotationColourChooser.java index 41c20bd..25e08b0 100755 --- a/src/jalview/appletgui/AnnotationColourChooser.java +++ b/src/jalview/appletgui/AnnotationColourChooser.java @@ -82,16 +82,17 @@ public class AnnotationColourChooser extends Panel implements return; } + minColour.setBackground(av.applet.getDefaultColourParameter("ANNOTATIONCOLOUR_MIN",Color.orange)); + maxColour.setBackground(av.applet.getDefaultColourParameter("ANNOTATIONCOLOUR_MAX",Color.red)); + if (oldcs instanceof AnnotationColourGradient) { AnnotationColourGradient acg = (AnnotationColourGradient) oldcs; - minColour.setBackground(acg.getMinColour()); - maxColour.setBackground(acg.getMaxColour()); - } - else - { - minColour.setBackground(Color.orange); - maxColour.setBackground(Color.red); + currentColours.setState(acg.predefinedColours); + if (!acg.predefinedColours) { + minColour.setBackground(acg.getMinColour()); + maxColour.setBackground(acg.getMaxColour()); + } } adjusting = true; @@ -116,6 +117,27 @@ public class AnnotationColourChooser extends Panel implements threshold.addItem("Above Threshold"); threshold.addItem("Below Threshold"); + if (oldcs instanceof AnnotationColourGradient) + { + AnnotationColourGradient acg = (AnnotationColourGradient) oldcs; + annotations.select(acg.getAnnotation()); + switch (acg.getAboveThreshold()) { + case AnnotationColourGradient.NO_THRESHOLD: + threshold.select("No Threshold"); + break; + case AnnotationColourGradient.ABOVE_THRESHOLD: + threshold.select("Above Threshold"); + break; + case AnnotationColourGradient.BELOW_THRESHOLD: + threshold.select("Below Threshold"); + break; + default: + throw new Error("Implementation error: don't know about threshold setting for current AnnotationColourGradient."); + } + thresholdIsMin.setState(acg.thresholdIsMinMax); + thresholdValue.setText(""+acg.getAnnotationThreshold()); + } + adjusting = false; changeColour(); @@ -430,7 +452,8 @@ public class AnnotationColourChooser extends Panel implements } } - ap.paintAlignment(false); + // update colours in linked windows + ap.paintAlignment(true); } void reset()