protected void drawHorizontalItem(Graphics2D g2,CategoryItemRendererState state,Rectangle2D dataArea,CategoryPlot plot,CategoryAxis domainAxis,ValueAxis rangeAxis,CategoryDataset dataset,int row,int column){
  Number dataValue=dataset.getValue(row,column);
  if (dataValue == null) {
    return;
  }
  double value=dataValue.doubleValue();
  double base=0.0;
  double lclip=getLowerClip();
  double uclip=getUpperClip();
  if (uclip <= 0.0) {
    if (value >= uclip) {
      return;
    }
    base=uclip;
    if (value <= lclip) {
      value=lclip;
    }
  }
 else   if (lclip <= 0.0) {
    if (value >= uclip) {
      value=uclip;
    }
 else {
      if (value <= lclip) {
        value=lclip;
      }
    }
  }
 else {
    if (value <= lclip) {
      return;
    }
    base=lclip;
    if (value >= uclip) {
      value=uclip;
    }
  }
  RectangleEdge edge=plot.getRangeAxisEdge();
  double transX1=rangeAxis.valueToJava2D(base,dataArea,edge);
  double transX2=rangeAxis.valueToJava2D(value,dataArea,edge);
  double rectX=Math.min(transX1,transX2);
  double rectWidth=Math.abs(transX2 - transX1);
  double rectY=domainAxis.getCategoryMiddle(column,getColumnCount(),dataArea,plot.getDomainAxisEdge()) - state.getBarWidth() / 2.0;
  int seriesCount=getRowCount();
  double shift=0.0;
  double rectHeight;
  double widthFactor=1.0;
  double seriesBarWidth=getSeriesBarWidth(row);
  if (!Double.isNaN(seriesBarWidth)) {
    widthFactor=seriesBarWidth;
  }
  rectHeight=widthFactor * state.getBarWidth();
  rectY=rectY + (1 - widthFactor) * state.getBarWidth() / 2.0;
  if (seriesCount > 1) {
    shift=rectHeight * 0.20 / (seriesCount - 1);
  }
  Rectangle2D bar=new Rectangle2D.Double(rectX,(rectY + ((seriesCount - 1 - row) * shift)),rectWidth,(rectHeight - (seriesCount - 1 - row) * shift * 2));
  if (state.getElementHinting()) {
    beginElementGroup(g2,dataset.getRowKey(row),dataset.getColumnKey(column));
  }
  Paint itemPaint=getItemPaint(row,column);
  GradientPaintTransformer t=getGradientPaintTransformer();
  if (t != null && itemPaint instanceof GradientPaint) {
    itemPaint=t.transform((GradientPaint)itemPaint,bar);
  }
  g2.setPaint(itemPaint);
  g2.fill(bar);
  if (isDrawBarOutline() && state.getBarWidth() > BAR_OUTLINE_WIDTH_THRESHOLD) {
    Stroke stroke=getItemOutlineStroke(row,column);
    Paint paint=getItemOutlinePaint(row,column);
    if (stroke != null && paint != null) {
      g2.setStroke(stroke);
      g2.setPaint(paint);
      g2.draw(bar);
    }
  }
  CategoryItemLabelGenerator generator=getItemLabelGenerator(row,column);
  if (generator != null && isItemLabelVisible(row,column)) {
    drawItemLabel(g2,dataset,row,column,plot,generator,bar,(transX1 > transX2));
  }
  EntityCollection entities=state.getEntityCollection();
  if (entities != null) {
    addItemEntity(entities,dataset,row,column,bar);
  }
}

protected void drawHorizontalItem ( Graphics2D g2 , CategoryItemRendererState state , Rectangle2D dataArea , CategoryPlot plot , CategoryAxis domainAxis , ValueAxis rangeAxis , CategoryDataset dataset , int row , int column ) { Number dataValue = dataset . getValue ( row , column ) ; if ( dataValue == null ) { return ; } double value = dataValue . doubleValue ( ) ; double base = 0.0 ; double lclip = getLowerClip ( ) ; double uclip = getUpperClip ( ) ; if ( uclip <= 0.0 ) { if ( value >= uclip ) { return ; } base = uclip ; if ( value <= lclip ) { value = lclip ; } } else if ( lclip <= 0.0 ) { if ( value >= uclip ) { value = uclip ; } else { if ( value <= lclip ) { value = lclip ; } } } else { if ( value <= lclip ) { return ; } base = lclip ; if ( value >= uclip ) { value = uclip ; } } RectangleEdge edge = plot . getRangeAxisEdge ( ) ; double transX1 = rangeAxis . valueToJava2D ( base , dataArea , edge ) ; double transX2 = rangeAxis . valueToJava2D ( value , dataArea , edge ) ; double rectX = Math . min ( transX1 , transX2 ) ; double rectWidth = Math . abs ( transX2 - transX1 ) ; double rectY = domainAxis . getCategoryMiddle ( column , getColumnCount ( ) , dataArea , plot . getDomainAxisEdge ( ) ) - state . getBarWidth ( ) / 2.0 ; int seriesCount = getRowCount ( ) ; double shift = 0.0 ; double rectHeight ; double widthFactor = 1.0 ; double seriesBarWidth = getSeriesBarWidth ( row ) ; if ( ! Double . isNaN ( seriesBarWidth ) ) { widthFactor = seriesBarWidth ; } rectHeight = widthFactor * state . getBarWidth ( ) ; rectY = rectY + ( 1 - widthFactor ) * state . getBarWidth ( ) / 2.0 ; if ( seriesCount > 1 ) { shift = rectHeight * 0.20 / ( seriesCount - 1 ) ; } Rectangle2D bar = new Rectangle2D . Double ( rectX , ( rectY + ( ( seriesCount - 1 - row ) * shift ) ) , rectWidth , ( rectHeight - ( seriesCount - 1 - row ) * shift * 2 ) ) ; if ( state . getElementHinting ( ) ) { beginElementGroup ( g2 , dataset . getRowKey ( row ) , dataset . getColumnKey ( column ) ) ; } Paint itemPaint = getItemPaint ( row , column ) ; GradientPaintTransformer t = getGradientPaintTransformer ( ) ; if ( t != null && itemPaint instanceof GradientPaint ) { itemPaint = t . transform ( ( GradientPaint ) itemPaint , bar ) ; } g2 . setPaint ( itemPaint ) ; g2 . fill ( bar ) ; if ( isDrawBarOutline ( ) && state . getBarWidth ( ) > BAR_OUTLINE_WIDTH_THRESHOLD ) { Stroke stroke = getItemOutlineStroke ( row , column ) ; Paint paint = getItemOutlinePaint ( row , column ) ; if ( stroke != null && paint != null ) { g2 . setStroke ( stroke ) ; g2 . setPaint ( paint ) ; g2 . draw ( bar ) ; } } CategoryItemLabelGenerator generator = getItemLabelGenerator ( row , column ) ; if ( generator != null && isItemLabelVisible ( row , column ) ) { drawItemLabel ( g2 , dataset , row , column , plot , generator , bar , ( transX1 > transX2 ) ) ; } EntityCollection entities = state . getEntityCollection ( ) ; if ( entities != null ) { addItemEntity ( entities , dataset , row , column , bar ) ; } }
draws the bar for a single ( series , category ) data item .
