public void drawRangeLine(Graphics2D g2,CategoryPlot plot,ValueAxis axis,Rectangle2D dataArea,double value,Paint paint,Stroke stroke){
  Range range=axis.getRange();
  if (!range.contains(value)) {
    return;
  }
  PlotOrientation orientation=plot.getOrientation();
  Line2D line=null;
  double v=axis.valueToJava2D(value,dataArea,plot.getRangeAxisEdge());
  if (orientation == PlotOrientation.HORIZONTAL) {
    line=new Line2D.Double(v,dataArea.getMinY(),v,dataArea.getMaxY());
  }
 else   if (orientation == PlotOrientation.VERTICAL) {
    line=new Line2D.Double(dataArea.getMinX(),v,dataArea.getMaxX(),v);
  }
  g2.setPaint(paint);
  g2.setStroke(stroke);
  Object saved=g2.getRenderingHint(RenderingHints.KEY_STROKE_CONTROL);
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_NORMALIZE);
  g2.draw(line);
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,saved);
}

public void drawRangeLine ( Graphics2D g2 , CategoryPlot plot , ValueAxis axis , Rectangle2D dataArea , double value , Paint paint , Stroke stroke ) { Range range = axis . getRange ( ) ; if ( ! range . contains ( value ) ) { return ; } PlotOrientation orientation = plot . getOrientation ( ) ; Line2D line = null ; double v = axis . valueToJava2D ( value , dataArea , plot . getRangeAxisEdge ( ) ) ; if ( orientation == PlotOrientation . HORIZONTAL ) { line = new Line2D . Double ( v , dataArea . getMinY ( ) , v , dataArea . getMaxY ( ) ) ; } else if ( orientation == PlotOrientation . VERTICAL ) { line = new Line2D . Double ( dataArea . getMinX ( ) , v , dataArea . getMaxX ( ) , v ) ; } g2 . setPaint ( paint ) ; g2 . setStroke ( stroke ) ; Object saved = g2 . getRenderingHint ( RenderingHints . KEY_STROKE_CONTROL ) ; g2 . setRenderingHint ( RenderingHints . KEY_STROKE_CONTROL , RenderingHints . VALUE_STROKE_NORMALIZE ) ; g2 . draw ( line ) ; g2 . setRenderingHint ( RenderingHints . KEY_STROKE_CONTROL , saved ) ; }
draws a line perpendicular to the range axis .
