Hi Alice,

I think you have two problems, one easily solved the other not.

1) (easy) You need to upgrade to Batik 1.5.1 or else call
'getGeneratorContext().setPrecision(<n>)' on the SVGGraphics2D.
  This will eliminate the Null Pointer Exception (NPE).

2) SVGGraphics2D doesn't support XOR mode (mostly because
   SVG doesn't support it).  I don't believe this has anything
   to do with your NPE - but it might make the generated drawing
   "wrong".  It strikes me as a little odd to be drawing something
   with XOR for a static picture (it's usually used for interactive
   stuff).  If you just want a high-contrast line you may want to try
   drawing the path with a wide black stroke then a narrower 'white'
   stroke (perhaps with a dash or something).


Alice Mello Cavallo wrote:


  I have an application in Java that draws a face using custom classes.
[...] Below is the error message.

Error msg:

XOR Mode is not supported by Graphics2D SVG Generator
java.lang.NullPointerException
at org.apache.batik.svggen.SVGGeneratorContext.doubleString(Unknown Source)
at org.apache.batik.svggen.SVGGraphicObjectConverter.doubleString(Unknown Source)
at org.apache.batik.svggen.SVGLine.toSVG(Unknown Source)
at org.apache.batik.svggen.SVGShape.toSVG(Unknown Source)
at org.apache.batik.svggen.SVGGraphics2D.draw(Unknown Source)
at faceLL.Segment.paint(Segment.java:222)
at faceLL.Contour.paint(Contour.java:55)
at faceLL.Face.paint(Face.java:45)
at faceLL.ElasticFace$MyFrame.paint(ElasticFace.java:107)
at faceLL.ElasticFace.main(ElasticFace.java:243)



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



Reply via email to