- if(aboveThreshold!=AnnotationColourGradient.NO_THRESHOLD && aa.threshold==null)\r
- {\r
- aa.setThreshold(new jalview.datamodel.GraphLine((aa.graphMax-aa.graphMin)/2f, "Threshold", Color.black));\r
- }\r
-\r
- AnnotationColourGradient acg = new AnnotationColourGradient(aa,\r
- minColour.getBackground(),\r
- maxColour.getBackground(),\r
- aboveThreshold );\r
+ if (aboveThreshold == AnnotationColourGradient.NO_THRESHOLD)\r
+ {\r
+ currentAnnotation.threshold = null;\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
+ 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.setMinorTickSpacing( (int) (range / 100f));\r
+ slider.setEnabled(true);\r
+ thresholdValue.setEnabled(true);\r
+ }\r