if (str != null)
useSubrangePaint = "true".equals(str.toLowerCase());
Plot plot = ((JFreeChart) chart).getPlot();
if (plot instanceof ThermometerPlot) {
ThermometerPlot tplot = (ThermometerPlot) plot;
tplot.setUnits(units);
tplot.setUseSubrangePaint(false);
tplot.setThermometerPaint(thermometerColor);
tplot.setMercuryPaint(mercuryColor);
tplot.setValuePaint(valueColor);
tplot.setLowerBound(lowerBound);
tplot.setSubrange(ThermometerPlot.NORMAL, lowerBound, warningPoint);
tplot.setSubrange(ThermometerPlot.WARNING, warningPoint, criticalPoint);
tplot.setSubrange(ThermometerPlot.CRITICAL, criticalPoint, upperBound);
tplot.setUpperBound(upperBound);
tplot.setUseSubrangePaint(useSubrangePaint);
tplot.setSubrangeIndicatorsVisible(subrangeIndicatorsVisible);
tplot.setSubrangePaint(ThermometerPlot.NORMAL, normalColor);
tplot.setSubrangePaint(ThermometerPlot.WARNING, warningColor);
tplot.setSubrangePaint(ThermometerPlot.CRITICAL, criticalColor);
}
}