- // Check if combobox is still adjusting
- if (adjusting)
- {
- return;
- }
-
- currentAnnotation = av.getAlignment().getAlignmentAnnotation()[annmap[annotations
- .getSelectedIndex()]];
-
- int aboveThreshold = -1;
- if (threshold.getSelectedIndex() == 1)
- {
- aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;
- }
- else if (threshold.getSelectedIndex() == 2)
- {
- aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;
- }
-
- slider.setEnabled(true);
- thresholdValue.setEnabled(true);
- thresholdIsMin.setEnabled(true);
-
- if (aboveThreshold == AnnotationColourGradient.NO_THRESHOLD)
- {
- slider.setEnabled(false);
- thresholdValue.setEnabled(false);
- thresholdValue.setText("");
- thresholdIsMin.setEnabled(false);
- }
- else if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD
- && currentAnnotation.threshold == null)
- {
- currentAnnotation
- .setThreshold(new jalview.datamodel.GraphLine(
- (currentAnnotation.graphMax - currentAnnotation.graphMin) / 2f,
- "Threshold", Color.black));
- }
-
- if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD)
- {
- adjusting = true;
- float range = currentAnnotation.graphMax * 1000
- - currentAnnotation.graphMin * 1000;
-
- slider.setMinimum((int) (currentAnnotation.graphMin * 1000));
- slider.setMaximum((int) (currentAnnotation.graphMax * 1000));
- slider.setValue((int) (currentAnnotation.threshold.value * 1000));
- thresholdValue.setText(currentAnnotation.threshold.value + "");
- slider.setMajorTickSpacing((int) (range / 10f));
- slider.setEnabled(true);
- thresholdValue.setEnabled(true);
- adjusting = false;
- }
-
- AnnotationColourGradient acg = null;
- if (currentColours.isSelected())
- {
- acg = new AnnotationColourGradient(currentAnnotation,
- av.getGlobalColourScheme(), aboveThreshold);
- }
- else
- {
- acg = new AnnotationColourGradient(currentAnnotation,
- minColour.getBackground(), maxColour.getBackground(),
- aboveThreshold);
- }
- acg.setSeqAssociated(seqAssociated.isSelected());
-
- if (currentAnnotation.graphMin == 0f
- && currentAnnotation.graphMax == 0f)
- {
- acg.setPredefinedColours(true);
- }
-
- acg.thresholdIsMinMax = thresholdIsMin.isSelected();
-
- av.setGlobalColourScheme(acg);
-