* @return A map containing the state for each axis drawn.
*/
protected Map<Axis, AxisState> drawAxes(Graphics2D g2, Rectangle2D plotArea,
Rectangle2D dataArea, PlotRenderingInfo plotState) {
AxisCollection axisCollection = new AxisCollection();
// add domain axes to lists...
for (ValueAxis axis : this.domainAxes.values()) {
if (axis != null) {
int axisIndex = findDomainAxisIndex(axis);
axisCollection.add(axis, getDomainAxisEdge(axisIndex));
}
}
// add range axes to lists...
for (ValueAxis axis : this.rangeAxes.values()) {
if (axis != null) {
int axisIndex = findRangeAxisIndex(axis);
axisCollection.add(axis, getRangeAxisEdge(axisIndex));
}
}
Map<Axis, AxisState> axisStateMap = new HashMap<Axis, AxisState>();
// draw the top axes
double cursor = dataArea.getMinY() - this.axisOffset.calculateTopOutset(
dataArea.getHeight());
for (Axis axis1 : axisCollection.getAxesAtTop()) {
ValueAxis axis = (ValueAxis) axis1;
AxisState info = axis.draw(g2, cursor, plotArea, dataArea,
RectangleEdge.TOP, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the bottom axes
cursor = dataArea.getMaxY()
+ this.axisOffset.calculateBottomOutset(dataArea.getHeight());
for (Axis axis1 : axisCollection.getAxesAtBottom()) {
ValueAxis axis = (ValueAxis) axis1;
AxisState info = axis.draw(g2, cursor, plotArea, dataArea,
RectangleEdge.BOTTOM, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the left axes
cursor = dataArea.getMinX()
- this.axisOffset.calculateLeftOutset(dataArea.getWidth());
for (Axis axis1 : axisCollection.getAxesAtLeft()) {
ValueAxis axis = (ValueAxis) axis1;
AxisState info = axis.draw(g2, cursor, plotArea, dataArea,
RectangleEdge.LEFT, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);
}
// draw the right axes
cursor = dataArea.getMaxX()
+ this.axisOffset.calculateRightOutset(dataArea.getWidth());
for (Axis axis1 : axisCollection.getAxesAtRight()) {
ValueAxis axis = (ValueAxis) axis1;
AxisState info = axis.draw(g2, cursor, plotArea, dataArea,
RectangleEdge.RIGHT, plotState);
cursor = info.getCursor();
axisStateMap.put(axis, info);