You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Thomas DeWeese <Th...@Kodak.com> on 2004/03/04 23:18:15 UTC
Re: SVGGenerator
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: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
quick question
Posted by Danny Browne <da...@eircom.net>.
can anyone tell me how i draw temporary outline of a shape before it is
added to the SVG document. i.e the outline of a rectangle while the mouse is
being dragged
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: SVGGenerator
Posted by Thomas DeWeese <Th...@Kodak.com>.
Alice Mello Cavallo wrote:
> Which jars should I import in order to use SVGGenerator?
See: http://xml.apache.org/batik/install.html#jarFiles
It appears you may be able to pair things down a bit from
this (in particular I don't think there is actually a
dependency on 'gvt' from svggen - and it is possible you
can 'get away' without batik.parser.
> I have tried to import only batik-svggen and batik-dom, but it did not
> work, therefore I imported all available.
> Thanks,
> Alice
> At 05:18 PM 3/4/2004 -0500, Thomas DeWeese wrote:
>
>> 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: batik-dev-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-dev-help@xml.apache.org
>
>
> Alice Cristina Mello Cavallo
> Interdisciplinary PhD Candidate at Tufts University
> Learning, Technology and Drama
> http://www.media.mit.edu/~mello/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: SVGGenerator
Posted by Alice Mello Cavallo <me...@media.mit.edu>.
Which jars should I import in order to use SVGGenerator?
I have tried to import only batik-svggen and batik-dom, but it did not
work, therefore I imported all available.
Thanks,
Alice
At 05:18 PM 3/4/2004 -0500, Thomas DeWeese wrote:
>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: batik-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: batik-dev-help@xml.apache.org
Alice Cristina Mello Cavallo
Interdisciplinary PhD Candidate at Tufts University
Learning, Technology and Drama
http://www.media.mit.edu/~mello/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org