import javax.swing.*;
import javax.swing.event.*;
+import jalview.bin.Cache;
import jalview.datamodel.*;
import jalview.schemes.*;
import java.awt.Dimension;
return;
}
+ // Always get default shading from preferences.
+ minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", Color.orange));
+ maxColour.setBackground(Cache.getDefaultColour("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.setSelected(acg.predefinedColours);
+ if (acg.predefinedColours)
+ {
+
+ } else {
+ 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.setSelectedItem(acg.getAnnotation());
+ switch (acg.getAboveThreshold()) {
+ case AnnotationColourGradient.NO_THRESHOLD:
+ threshold.setSelectedItem("No Threshold");
+ break;
+ case AnnotationColourGradient.ABOVE_THRESHOLD:
+ threshold.setSelectedItem("Above Threshold");
+ break;
+ case AnnotationColourGradient.BELOW_THRESHOLD:
+ threshold.setSelectedItem("Below Threshold");
+ break;
+ default:
+ throw new Error("Implementation error: don't know about threshold setting for current AnnotationColourGradient.");
+ }
+ thresholdIsMin.setSelected(acg.thresholdIsMinMax);
+ thresholdValue.setText(""+acg.getAnnotationThreshold());
+ }
+
try
{
jbInit();
adjusting = false;
changeColour();
+ validate();
}
}
}
-
- ap.paintAlignment(false);
+ // ensure all associated views (overviews, structures, etc) are notified of updated colours.
+ ap.paintAlignment(true);
}
public void ok_actionPerformed(ActionEvent e)