sun.dc.pr.PRException: endPath: bad path exception-defect

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
prolaznik22
Posts: 11
Joined: Fri Feb 03, 2006 9:27 pm

sun.dc.pr.PRException: endPath: bad path exception-defect

Post by prolaznik22 » Fri Feb 03, 2006 9:42 pm

Hi,

I have noticed that (sun.dc.pr.PRException: endPath: bad path) exception gets thrown every time you zoom (5-6 times at least) in on the chart. This is a java defect. Supposedly, it is fixed in 5.0 version. In any case, I wrote my customrenderer that fixes this issue. I have noticed that some people were asking about this issue, so I am posting my code.

Code: Select all

 class MyStackedBarRenderer extends StackedBarRenderer
  implements 
  Cloneable, 
  Serializable {

     MyStackedBarRenderer () {

       super();

     }
    
     public void 
     drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) {
   
       Object oldValue = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING); 
       Object newValue = RenderingHints.VALUE_ANTIALIAS_OFF; 
       boolean valueChanged = false; 
       if (oldValue == null || !oldValue.equals(newValue)) { 
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, newValue); 
        valueChanged = true; 
      } 

      super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column, pass); 

     if (valueChanged) { 
       g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldValue); 
     } 
     
    }

  }

Locked