hi,

i try to render one of the example-files (batik3d.svg) directly into a
graphics2d context. the following code produces an exception

------------------------------------------------------------------------

String uri = new File("batik3d.svg").toURL().toString();

UserAgent userAgent = new PainterUserAgent();
DocumentLoader docLoader = new DocumentLoader(userAgent);
Document doc = docLoader.loadDocument(uri);

GraphicsNodeRenderContext rc = new
DynamicRendererFactory().getRenderContext();
GVTBuilder builder = new GVTBuilder();

GraphicsNode root = builder.build(new BridgeContext(userAgent, rc), doc);

root.paint(g2d, rc);

------------------------------------------------------------------------

the PainterUserAgent is a simple user agent which returns
"org.apache.crimson.parser.XMLReaderImpl" as the XML parser class name.

some files do work with this code, but with batik3d.svg i get the following
exception:

java.lang.NullPointerException:
 at
org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:404)
 at org.apache.batik.gvt.ShapeNode.paint(ShapeNode.java:115)
 at 
org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:129)
 at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:398)
 at 
org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:129)
 at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:61)
 at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:398)
 at 
org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:129)
 at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:398)
 at test.<init>(test.java:17)
 at test.main(test.java:61)

i didn't find out what causes the exception. i hope someone can halp me.

all the best

juerg lehni





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to