protected void drawItemLabel(Graphics2D g2,CategoryDataset data,int row,int column,CategoryPlot plot,CategoryItemLabelGenerator generator,Rectangle2D bar,boolean negative){
  String label=generator.generateLabel(data,row,column);
  if (label == null) {
    return;
  }
  Font labelFont=getItemLabelFont(row,column);
  g2.setFont(labelFont);
  Paint paint=getItemLabelPaint(row,column);
  g2.setPaint(paint);
  ItemLabelPosition position;
  if (!negative) {
    position=getPositiveItemLabelPosition(row,column);
  }
 else {
    position=getNegativeItemLabelPosition(row,column);
  }
  Point2D anchorPoint=calculateLabelAnchorPoint(position.getItemLabelAnchor(),bar,plot.getOrientation());
  if (isInternalAnchor(position.getItemLabelAnchor())) {
    Shape bounds=TextUtilities.calculateRotatedStringBounds(label,g2,(float)anchorPoint.getX(),(float)anchorPoint.getY(),position.getTextAnchor(),position.getAngle(),position.getRotationAnchor());
    if (bounds != null) {
      if (!bar.contains(bounds.getBounds2D())) {
        if (!negative) {
          position=getPositiveItemLabelPositionFallback();
        }
 else {
          position=getNegativeItemLabelPositionFallback();
        }
        if (position != null) {
          anchorPoint=calculateLabelAnchorPoint(position.getItemLabelAnchor(),bar,plot.getOrientation());
        }
      }
    }
  }
  if (position != null) {
    TextUtilities.drawRotatedString(label,g2,(float)anchorPoint.getX(),(float)anchorPoint.getY(),position.getTextAnchor(),position.getAngle(),position.getRotationAnchor());
  }
}

protected void drawItemLabel ( Graphics2D g2 , CategoryDataset data , int row , int column , CategoryPlot plot , CategoryItemLabelGenerator generator , Rectangle2D bar , boolean negative ) { String label = generator . generateLabel ( data , row , column ) ; if ( label == null ) { return ; } Font labelFont = getItemLabelFont ( row , column ) ; g2 . setFont ( labelFont ) ; Paint paint = getItemLabelPaint ( row , column ) ; g2 . setPaint ( paint ) ; ItemLabelPosition position ; if ( ! negative ) { position = getPositiveItemLabelPosition ( row , column ) ; } else { position = getNegativeItemLabelPosition ( row , column ) ; } Point2D anchorPoint = calculateLabelAnchorPoint ( position . getItemLabelAnchor ( ) , bar , plot . getOrientation ( ) ) ; if ( isInternalAnchor ( position . getItemLabelAnchor ( ) ) ) { Shape bounds = TextUtilities . calculateRotatedStringBounds ( label , g2 , ( float ) anchorPoint . getX ( ) , ( float ) anchorPoint . getY ( ) , position . getTextAnchor ( ) , position . getAngle ( ) , position . getRotationAnchor ( ) ) ; if ( bounds != null ) { if ( ! bar . contains ( bounds . getBounds2D ( ) ) ) { if ( ! negative ) { position = getPositiveItemLabelPositionFallback ( ) ; } else { position = getNegativeItemLabelPositionFallback ( ) ; } if ( position != null ) { anchorPoint = calculateLabelAnchorPoint ( position . getItemLabelAnchor ( ) , bar , plot . getOrientation ( ) ) ; } } } } if ( position != null ) { TextUtilities . drawRotatedString ( label , g2 , ( float ) anchorPoint . getX ( ) , ( float ) anchorPoint . getY ( ) , position . getTextAnchor ( ) , position . getAngle ( ) , position . getRotationAnchor ( ) ) ; } }
draws an item label . this method is overridden so that the bar can be used to calculate the label anchor point .
