JAL-2624 check feature colour threshold when colouring structure
[jalview.git] / src / jalview / appletgui / FeatureColourChooser.java
index 3c04ccd..4075e8b 100644 (file)
@@ -95,9 +95,11 @@ public class FeatureColourChooser extends Panel implements ActionListener,
     float mm[] = fr.getMinMax().get(type)[0];
     min = mm[0];
     max = mm[1];
+    threshline = new GraphLine((max - min) / 2f, "Threshold", Color.black);
     oldcs = fr.getFeatureColours().get(type);
     if (oldcs.isGraduatedColour())
     {
+      threshline.value = oldcs.getThreshold();
       cs = new FeatureColour((FeatureColour) oldcs, min, max);
     }
     else
@@ -191,11 +193,11 @@ public class FeatureColourChooser extends Panel implements ActionListener,
     jPanel4.setBackground(Color.white);
     threshold.addItemListener(this);
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_no_thereshold"));
+            .getString("label.threshold_feature_no_threshold"));
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_above_thereshold"));
+            .getString("label.threshold_feature_above_threshold"));
     threshold.addItem(MessageManager
-            .getString("label.threshold_feature_below_thereshold"));
+            .getString("label.threshold_feature_below_threshold"));
     thresholdValue.addActionListener(this);
     slider.setBackground(Color.white);
     slider.setEnabled(false);
@@ -384,14 +386,6 @@ public class FeatureColourChooser extends Panel implements ActionListener,
       thresholdValue.setText("");
     }
 
-    else if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD
-            && threshline == null)
-    {
-      // todo visual indication of feature threshold
-      threshline = new jalview.datamodel.GraphLine((max - min) / 2f,
-              "Threshold", Color.black);
-    }
-
     if (aboveThreshold != AnnotationColourGradient.NO_THRESHOLD)
     {
       adjusting = true;