/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
* Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
* This file is part of Jalview.
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;
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();
AnnotationColourGradient acg = null;
if (currentColours.getState())
{
- acg = new AnnotationColourGradient(currentAnnotation, av
- .getGlobalColourScheme(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ av.getGlobalColourScheme(), aboveThreshold);
}
else
{
- acg = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(), aboveThreshold);
+ acg = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
+ aboveThreshold);
}
if (currentAnnotation.graphMin == 0f
}
else
{
- sg.cs = new AnnotationColourGradient(currentAnnotation, minColour
- .getBackground(), maxColour.getBackground(),
+ sg.cs = new AnnotationColourGradient(currentAnnotation,
+ minColour.getBackground(), maxColour.getBackground(),
aboveThreshold);
}
}
}
- ap.paintAlignment(false);
+ // update colours in linked windows
+ ap.paintAlignment(true);
}
void reset()