+<h1>Don't rely comparisons on labels</h1>\r
+<p>Don't use this type of coding:\r
+ threshold.addItem("No Threshold");<br>\r
+ threshold.addItem("Above Threshold");<br>\r
+ threshold.addItem("Below Threshold");<br>\r
+ [...]<br>\r
+ if (threshold.getSelectedItem().equals("Above Threshold"))<br>\r
+ {</br>\r
+ aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;<br>\r
+ }<br>\r
+ else if (threshold.getSelectedItem().equals("Below Threshold"))<br>\r
+ {<br>\r
+ aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;<br>\r
+ }<br>\r
+</p>\r
+<p>Once text has been translated, these equals will fail as the label won't be the English ones. It should be used getSelectedIndex() instead of getSelectedItem(). If you do the proper way, the code will look like this:<br>\r
+ threshold.addItem(MessageManager.getString("label.threshold_feature_no_thereshold"));<br>\r
+ threshold.addItem(MessageManager.getString("label.threshold_feature_above_thereshold"));<br>\r
+ threshold.addItem(MessageManager.getString("label.threshold_feature_below_thereshold"));<br>\r
+ [...]<br>\r
+ if (threshold.getSelectedIndex()==1)<br>\r
+ {<br>\r
+ aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;<br>\r
+ }<br>\r
+ else if (threshold.getSelectedIndex()==2)<br>\r
+ {<br>\r
+ aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;<br>\r
+ }<br> \r
+</p>\r