final AxisCollection axisCollection = new AxisCollection();
// add domain axes to lists...
for (int index = 0; index < this.domainAxes.size(); index++) {
final ValueAxis axis = (ValueAxis) this.domainAxes.get(index);
if (axis != null) {
axisCollection.add(axis, this.getDomainAxisEdge(index));
}
}
// add range axes to lists...
for (int index = 0; index < this.rangeAxes.size(); index++) {
final ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(index);
if (yAxis != null) {
axisCollection.add(yAxis, this.getRangeAxisEdge(index));
}
}
final Map axisStateMap = new HashMap();
// draw the top axes
double cursor = RectangleUtil.getMinY(dataArea)
- this.axisOffset.calculateTopOutset(dataArea.height);
Iterator iterator = axisCollection.getAxesAtTop().iterator();
while (iterator.hasNext()) {
final ValueAxis axis = (ValueAxis) iterator.next();
final AxisState info = axis.draw(gc, cursor, plotArea, dataArea,
RectangleEdge.TOP, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the bottom axes
cursor = RectangleUtil.getMaxY(dataArea)
+ this.axisOffset.calculateBottomOutset(dataArea.height);
iterator = axisCollection.getAxesAtBottom().iterator();
while (iterator.hasNext()) {
final ValueAxis axis = (ValueAxis) iterator.next();
final AxisState info = axis.draw(gc, cursor, plotArea, dataArea,
RectangleEdge.BOTTOM, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the left axes
cursor = RectangleUtil.getMinX(dataArea)
- this.axisOffset.calculateLeftOutset(dataArea.width);
iterator = axisCollection.getAxesAtLeft().iterator();
while (iterator.hasNext()) {
final ValueAxis axis = (ValueAxis) iterator.next();
final AxisState info = axis.draw(gc, cursor, plotArea, dataArea,
RectangleEdge.LEFT, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the right axes
cursor = RectangleUtil.getMaxX(dataArea)
+ this.axisOffset.calculateRightOutset(dataArea.width);
iterator = axisCollection.getAxesAtRight().iterator();
while (iterator.hasNext()) {
final ValueAxis axis = (ValueAxis) iterator.next();
final AxisState info = axis.draw(gc, cursor, plotArea, dataArea,
RectangleEdge.RIGHT, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}