Hi,
I'm currently tryoing out the JFreeChart zooming capabilities. After several zoom operations, I get a
sun.dc.pr.PRException: endPath: bad path
exception.
This is how I can reproduce it:
- Use MouseZoomDemo
- The original range is -2.25 to 2.25 on yAxis and -11 to 11 on xAxis.
- Now I zoom in the center, always specified by a 2 x 2 grid zoom rectangle.
- After 5 zoom operations, the range now being at -0,0000250 to 0,0000250 on yAxis and -0,0005 to 0,0005 on xAxis, I get the above exception. (full stack trace below).
Does anyone has an explanation (a bug? has the zooming reached some kind of limitation?) or (better) knows a way how to fix it?
Regards,
Martin
sun.dc.pr.PRException: endPath: bad path
at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:45)
at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2182)
at com.jrefinery.chart.renderer.StandardXYItemRenderer.drawItem(StandardXYItemRenderer.java:397)
at com.jrefinery.chart.plot.XYPlot.render(XYPlot.java:1135)
at com.jrefinery.chart.plot.XYPlot.draw(XYPlot.java:1082)
at com.jrefinery.chart.JFreeChart.draw(JFreeChart.java:764)
at com.jrefinery.chart.ChartPanel.paintComponent(ChartPanel.java:831)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
PRException after multiple zooming?! (0.9.6)
Re: PRException after multiple zooming?! (0.9.6)
Hi Martin,
The problem can occur in several ways, the most likely here is that a Shape (probably a Line2D) is being drawn that has very large coordinates in Java 2D space. The definition of "large coordinates" varies by platform I think.
I recall reading in the Java bug database a while back that the only workaround is to implement your own clipping algorithms...I haven't done that, because I don't know how to do it efficiently. I'll have another hunt through the Java bug database and see what the current status is...
Regards,
Dave Gilbert
The problem can occur in several ways, the most likely here is that a Shape (probably a Line2D) is being drawn that has very large coordinates in Java 2D space. The definition of "large coordinates" varies by platform I think.
I recall reading in the Java bug database a while back that the only workaround is to implement your own clipping algorithms...I haven't done that, because I don't know how to do it efficiently. I'll have another hunt through the Java bug database and see what the current status is...
Regards,
Dave Gilbert
Re: PRException after multiple zooming?! (0.9.6)
Hi Dave,
thanks for your quick answer!
In the meantime I found an entry in the BugParade:
http://developer.java.sun.com/developer ... 55500.html
Also, a software called VisAD had the same problem
(http://www.loci.wisc.edu/visbio/dev.html):
Other VisAD Bugs
From zooming too far into a Java2D display:
sun.dc.pr.PRException: endPath: bad path [...]
In
http://www.biojava.org/pipermail/biojav ... 02875.html
someone states that this only happens with 1.4 and antialiasing on.
Maybe I somehow have to limit zooming to a certain degree or switch off antialiasing then ( I tried switching it off, and it helps, but doesn't look good, of course
.
I'd be glad if you'd find another workaround
Regards,
Martin
thanks for your quick answer!
In the meantime I found an entry in the BugParade:
http://developer.java.sun.com/developer ... 55500.html
Also, a software called VisAD had the same problem
(http://www.loci.wisc.edu/visbio/dev.html):
Other VisAD Bugs
From zooming too far into a Java2D display:
sun.dc.pr.PRException: endPath: bad path [...]
In
http://www.biojava.org/pipermail/biojav ... 02875.html
someone states that this only happens with 1.4 and antialiasing on.
Maybe I somehow have to limit zooming to a certain degree or switch off antialiasing then ( I tried switching it off, and it helps, but doesn't look good, of course

I'd be glad if you'd find another workaround

Regards,
Martin
Re: PRException after multiple zooming?! (0.9.6)
I had a bug like this forever, and sometimes I still get it if I zoom in too much.
Then I discovered I had a renderer set improperly. You might check this.
I re-wrote the zoom for my plots and added my own clipping routines.
(VisAD is very sophisticated stuff...if , you need 3D, you might also try Stanford's jfreehep)
Charles
Then I discovered I had a renderer set improperly. You might check this.
I re-wrote the zoom for my plots and added my own clipping routines.
(VisAD is very sophisticated stuff...if , you need 3D, you might also try Stanford's jfreehep)
Charles