double meterMiddleX = meterArea.getCenterX();
double meterMiddleY = meterArea.getCenterY();
// plot the data (unless the dataset is null)...
ValueDataset data = getDataset();
if (data != null) {
//double dataMin = data.getMinimumValue().doubleValue();
//double dataMax = data.getMaximumValue().doubleValue();
double dataMin = this.range.getLowerBound();
double dataMax = this.range.getUpperBound();
this.minMeterValue = dataMin;
this.meterCalcAngle = 180 + ((this.meterAngle - 180) / 2);
this.meterRange = dataMax - dataMin;
Shape savedClip = g2.getClip();
g2.clip(originalArea);
Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, getForegroundAlpha())
);
if (this.dialBackgroundPaint != null) {
drawArc(g2, originalArea, dataMin, dataMax, this.dialBackgroundPaint, 1);
}
drawTicks(g2, meterArea, dataMin, dataMax);
drawArcFor(g2, meterArea, data, FULL_DATA_RANGE);
if (this.normalRange != null) {
drawArcFor(g2, meterArea, data, NORMAL_DATA_RANGE);
}
if (this.warningRange != null) {
drawArcFor(g2, meterArea, data, WARNING_DATA_RANGE);
}
if (this.criticalRange != null) {
drawArcFor(g2, meterArea, data, CRITICAL_DATA_RANGE);
}
if (data.getValue() != null) {
double dataVal = data.getValue().doubleValue();
drawTick(g2, meterArea, dataVal, true, this.valuePaint, true, getUnits());
g2.setPaint(this.needlePaint);
g2.setStroke(new BasicStroke(2.0f));