@Override public AxisSpace reserveSpace(Graphics2D g2,Plot plot,Rectangle2D plotArea,RectangleEdge edge,AxisSpace space){
  if (space == null) {
    space=new AxisSpace();
  }
  if (!isVisible()) {
    return space;
  }
  double tickLabelHeight=0.0;
  double tickLabelWidth=0.0;
  if (isTickLabelsVisible()) {
    g2.setFont(getTickLabelFont());
    AxisState state=new AxisState();
    refreshTicks(g2,state,plotArea,edge);
    if (edge == RectangleEdge.TOP) {
      tickLabelHeight=state.getMax();
    }
 else     if (edge == RectangleEdge.BOTTOM) {
      tickLabelHeight=state.getMax();
    }
 else     if (edge == RectangleEdge.LEFT) {
      tickLabelWidth=state.getMax();
    }
 else     if (edge == RectangleEdge.RIGHT) {
      tickLabelWidth=state.getMax();
    }
  }
  Rectangle2D labelEnclosure=getLabelEnclosure(g2,edge);
  double labelHeight, labelWidth;
  if (RectangleEdge.isTopOrBottom(edge)) {
    labelHeight=labelEnclosure.getHeight();
    space.add(labelHeight + tickLabelHeight + this.categoryLabelPositionOffset,edge);
  }
 else   if (RectangleEdge.isLeftOrRight(edge)) {
    labelWidth=labelEnclosure.getWidth();
    space.add(labelWidth + tickLabelWidth + this.categoryLabelPositionOffset,edge);
  }
  return space;
}

@ Override public AxisSpace reserveSpace ( Graphics2D g2 , Plot plot , Rectangle2D plotArea , RectangleEdge edge , AxisSpace space ) { if ( space == null ) { space = new AxisSpace ( ) ; } if ( ! isVisible ( ) ) { return space ; } double tickLabelHeight = 0.0 ; double tickLabelWidth = 0.0 ; if ( isTickLabelsVisible ( ) ) { g2 . setFont ( getTickLabelFont ( ) ) ; AxisState state = new AxisState ( ) ; refreshTicks ( g2 , state , plotArea , edge ) ; if ( edge == RectangleEdge . TOP ) { tickLabelHeight = state . getMax ( ) ; } else if ( edge == RectangleEdge . BOTTOM ) { tickLabelHeight = state . getMax ( ) ; } else if ( edge == RectangleEdge . LEFT ) { tickLabelWidth = state . getMax ( ) ; } else if ( edge == RectangleEdge . RIGHT ) { tickLabelWidth = state . getMax ( ) ; } } Rectangle2D labelEnclosure = getLabelEnclosure ( g2 , edge ) ; double labelHeight , labelWidth ; if ( RectangleEdge . isTopOrBottom ( edge ) ) { labelHeight = labelEnclosure . getHeight ( ) ; space . add ( labelHeight + tickLabelHeight + this . categoryLabelPositionOffset , edge ) ; } else if ( RectangleEdge . isLeftOrRight ( edge ) ) { labelWidth = labelEnclosure . getWidth ( ) ; space . add ( labelWidth + tickLabelWidth + this . categoryLabelPositionOffset , edge ) ; } return space ; }
estimates the space required for the axis , given a specific drawing area .
