new Integer(domainIndex)));
if (domainIndex == 0) {
// grab the plot's annotations
Iterator iterator = this.annotations.iterator();
while (iterator.hasNext()) {
XYAnnotation annotation = (XYAnnotation) iterator.next();
if (annotation instanceof XYAnnotationBoundsInfo) {
includedAnnotations.add(annotation);
}
}
}
}
// or is it a range axis?
int rangeIndex = getRangeAxisIndex(axis);
if (rangeIndex >= 0) {
isDomainAxis = false;
mappedDatasets.addAll(getDatasetsMappedToRangeAxis(
new Integer(rangeIndex)));
if (rangeIndex == 0) {
Iterator iterator = this.annotations.iterator();
while (iterator.hasNext()) {
XYAnnotation annotation = (XYAnnotation) iterator.next();
if (annotation instanceof XYAnnotationBoundsInfo) {
includedAnnotations.add(annotation);
}
}
}
}
// iterate through the datasets that map to the axis and get the union
// of the ranges.
Iterator iterator = mappedDatasets.iterator();
while (iterator.hasNext()) {
XYDataset d = (XYDataset) iterator.next();
if (d != null) {
XYItemRenderer r = getRendererForDataset(d);
if (isDomainAxis) {
if (r != null) {
result = Range.combine(result, r.findDomainBounds(d));
}
else {
result = Range.combine(result,
DatasetUtilities.findDomainBounds(d));
}
}
else {
if (r != null) {
result = Range.combine(result, r.findRangeBounds(d));
}
else {
result = Range.combine(result,
DatasetUtilities.findRangeBounds(d));
}
}
// FIXME: the XYItemRenderer interface doesn't specify the
// getAnnotations() method but it should
if (r instanceof AbstractXYItemRenderer) {
AbstractXYItemRenderer rr = (AbstractXYItemRenderer) r;
Collection c = rr.getAnnotations();
Iterator i = c.iterator();
while (i.hasNext()) {
XYAnnotation a = (XYAnnotation) i.next();
if (a instanceof XYAnnotationBoundsInfo) {
includedAnnotations.add(a);
}
}
}