@Override public AxisState draw(Graphics2D g2,double cursor,Rectangle2D plotArea,Rectangle2D dataArea,RectangleEdge edge,PlotRenderingInfo plotState){
  if (!isVisible()) {
    return new AxisState(cursor);
  }
  CategoryPlot plot=(CategoryPlot)getPlot();
  Rectangle2D adjustedDataArea=new Rectangle2D.Double();
  if (plot.getRenderer() instanceof Effect3D) {
    Effect3D e3D=(Effect3D)plot.getRenderer();
    double adjustedX=dataArea.getMinX();
    double adjustedY=dataArea.getMinY();
    double adjustedW=dataArea.getWidth() - e3D.getXOffset();
    double adjustedH=dataArea.getHeight() - e3D.getYOffset();
    if (edge == RectangleEdge.LEFT || edge == RectangleEdge.BOTTOM) {
      adjustedY+=e3D.getYOffset();
    }
 else     if (edge == RectangleEdge.RIGHT || edge == RectangleEdge.TOP) {
      adjustedX+=e3D.getXOffset();
    }
    adjustedDataArea.setRect(adjustedX,adjustedY,adjustedW,adjustedH);
  }
 else {
    adjustedDataArea.setRect(dataArea);
  }
  if (isAxisLineVisible()) {
    drawAxisLine(g2,cursor,adjustedDataArea,edge);
  }
  AxisState state=new AxisState(cursor);
  if (isTickMarksVisible()) {
    drawTickMarks(g2,cursor,adjustedDataArea,edge,state);
  }
  state=drawCategoryLabels(g2,plotArea,adjustedDataArea,edge,state,plotState);
  if (getAttributedLabel() != null) {
    state=drawAttributedLabel(getAttributedLabel(),g2,plotArea,dataArea,edge,state);
  }
 else {
    state=drawLabel(getLabel(),g2,plotArea,dataArea,edge,state);
  }
  return state;
}

@ Override public AxisState draw ( Graphics2D g2 , double cursor , Rectangle2D plotArea , Rectangle2D dataArea , RectangleEdge edge , PlotRenderingInfo plotState ) { if ( ! isVisible ( ) ) { return new AxisState ( cursor ) ; } CategoryPlot plot = ( CategoryPlot ) getPlot ( ) ; Rectangle2D adjustedDataArea = new Rectangle2D . Double ( ) ; if ( plot . getRenderer ( ) instanceof Effect3D ) { Effect3D e3D = ( Effect3D ) plot . getRenderer ( ) ; double adjustedX = dataArea . getMinX ( ) ; double adjustedY = dataArea . getMinY ( ) ; double adjustedW = dataArea . getWidth ( ) - e3D . getXOffset ( ) ; double adjustedH = dataArea . getHeight ( ) - e3D . getYOffset ( ) ; if ( edge == RectangleEdge . LEFT || edge == RectangleEdge . BOTTOM ) { adjustedY += e3D . getYOffset ( ) ; } else if ( edge == RectangleEdge . RIGHT || edge == RectangleEdge . TOP ) { adjustedX += e3D . getXOffset ( ) ; } adjustedDataArea . setRect ( adjustedX , adjustedY , adjustedW , adjustedH ) ; } else { adjustedDataArea . setRect ( dataArea ) ; } if ( isAxisLineVisible ( ) ) { drawAxisLine ( g2 , cursor , adjustedDataArea , edge ) ; } AxisState state = new AxisState ( cursor ) ; if ( isTickMarksVisible ( ) ) { drawTickMarks ( g2 , cursor , adjustedDataArea , edge , state ) ; } state = drawCategoryLabels ( g2 , plotArea , adjustedDataArea , edge , state , plotState ) ; if ( getAttributedLabel ( ) != null ) { state = drawAttributedLabel ( getAttributedLabel ( ) , g2 , plotArea , dataArea , edge , state ) ; } else { state = drawLabel ( getLabel ( ) , g2 , plotArea , dataArea , edge , state ) ; } return state ; }
draws the axis on a java 2d graphics device ( such as the screen or a printer ) .
