g2.setPaint(p);
// draw outliers
double oRadius = state.getBarWidth() / 3; // outlier radius
List outliers = new ArrayList();
OutlierListCollection outlierListCollection
= new OutlierListCollection();
// From outlier array sort out which are outliers and put these into a
// list If there are any farouts, set the flag on the
// OutlierListCollection
List yOutliers = bawDataset.getOutliers(row, column);
if (yOutliers != null) {
for (int i = 0; i < yOutliers.size(); i++) {
double outlier = ((Number) yOutliers.get(i)).doubleValue();
Number minOutlier = bawDataset.getMinOutlier(row, column);
Number maxOutlier = bawDataset.getMaxOutlier(row, column);
Number minRegular = bawDataset.getMinRegularValue(row, column);
Number maxRegular = bawDataset.getMaxRegularValue(row, column);
if (outlier > maxOutlier.doubleValue()) {
outlierListCollection.setHighFarOut(true);
}
else if (outlier < minOutlier.doubleValue()) {
outlierListCollection.setLowFarOut(true);
}
else if (outlier > maxRegular.doubleValue()) {
yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea,
location);
outliers.add(new Outlier(xx + state.getBarWidth() / 2.0,
yyOutlier, oRadius));
}
else if (outlier < minRegular.doubleValue()) {
yyOutlier = rangeAxis.valueToJava2D(outlier, dataArea,
location);
outliers.add(new Outlier(xx + state.getBarWidth() / 2.0,
yyOutlier, oRadius));
}
Collections.sort(outliers);
}
// Process outliers. Each outlier is either added to the
// appropriate outlier list or a new outlier list is made
for (Iterator iterator = outliers.iterator(); iterator.hasNext();) {
Outlier outlier = (Outlier) iterator.next();
outlierListCollection.add(outlier);
}
for (Iterator iterator = outlierListCollection.iterator();
iterator.hasNext();) {
OutlierList list = (OutlierList) iterator.next();
Outlier outlier = list.getAveragedOutlier();
Point2D point = outlier.getPoint();
if (list.isMultiple()) {
drawMultipleEllipse(point, state.getBarWidth(), oRadius,
g2);
}
else {
drawEllipse(point, oRadius, g2);
}
}
// draw farout indicators
if (outlierListCollection.isHighFarOut()) {
drawHighFarOut(aRadius / 2.0, g2,
xx + state.getBarWidth() / 2.0, maxAxisValue);
}
if (outlierListCollection.isLowFarOut()) {
drawLowFarOut(aRadius / 2.0, g2,
xx + state.getBarWidth() / 2.0, minAxisValue);
}
}
// collect entity and tool tip information...