- AnnotationColourGradient acg = new AnnotationColourGradient(aa,\r
- minColour.getBackground(),\r
- maxColour.getBackground(),\r
- thresholdCheck.isSelected());\r
+ if (aboveThreshold == AnnotationColourGradient.NO_THRESHOLD)\r
+ {\r
+ slider.setEnabled(false);\r
+ thresholdValue.setEnabled(false);\r
+ thresholdValue.setText("");\r
+ }\r
+ else if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD &&\r
+ currentAnnotation.threshold == null)\r
+ {\r
+ currentAnnotation.setThreshold(new jalview.datamodel.GraphLine\r
+ ( (currentAnnotation.graphMax -\r
+ currentAnnotation.graphMin) / 2f,\r
+ "Threshold",\r
+ Color.black));\r
+ }\r
+\r
+ if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD)\r
+ {\r
+ adjusting = true;\r
+ float range = currentAnnotation.graphMax * 1000 -\r
+ currentAnnotation.graphMin * 1000;\r
+\r
+ slider.setMinimum( (int) (currentAnnotation.graphMin * 1000));\r
+ slider.setMaximum( (int) (currentAnnotation.graphMax * 1000));\r
+ slider.setValue( (int) (currentAnnotation.threshold.value * 1000));\r
+ thresholdValue.setText(currentAnnotation.threshold.value + "");\r
+ slider.setMajorTickSpacing( (int) (range / 10f));\r
+ slider.setEnabled(true);\r
+ thresholdValue.setEnabled(true);\r
+ adjusting = false;\r
+ }\r
+\r
+ AnnotationColourGradient acg = null;\r
+ if (currentColours.isSelected())\r
+ {\r
+ acg = new AnnotationColourGradient(\r
+ currentAnnotation,\r
+ av.getGlobalColourScheme(), aboveThreshold);\r
+ }\r
+ else\r
+ {\r
+ acg =\r
+ new AnnotationColourGradient(\r
+ currentAnnotation,\r
+ minColour.getBackground(),\r
+ maxColour.getBackground(),\r
+ aboveThreshold);\r
+ }\r
+\r
+ if(currentAnnotation.graphMin==0f&& currentAnnotation.graphMax==0f)\r
+ {\r
+ acg.predefinedColours = true;\r
+ }\r
+\r
+ acg.thresholdIsMinMax = thresholdIsMin.isSelected();\r
+\r
+ av.setGlobalColourScheme(acg);\r