xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keywan Najafi Tonekaboni ...@prometoys.net>
Subject Parsing SVG and grouping actions
Date Tue, 08 Apr 2008 16:19:23 GMT
Hi,

I work on a whiteboard for Jabber/XMPP. I use Batik and JSVGCanvas for
the GUI. I found in another whiteboard implementation [1] (which is not
using Batik) the class SVGUtil[2].

This class is a parser for SVG and connected with the other classes
doing the SVG, as far as I understand.

My question: Is there a ready parser from Batik available, which I could
use instead? 

Another question:

I draw something on the canvas with this code:

		svgG2D.setPaint(new Color(color.getRed(), color.getGreen(),
color.getBlue(), 64));
			svgG2D.fill(shape);
			svgG2D.setPaint(Color.BLACK);
			svgG2D.setStroke(new BasicStroke((float)1.5));
			svgG2D.draw(shape);
//			svgG2D.drawString("Keywan - 12.3.2007", (float)start.getX()+5,
(float)start.getY()+5); 
			Element root = doc.getDocumentElement();
			svgG2D.getRoot(root);

Can I group it somehow to one parent element, which I could append to my
jabber messages and send it.. I recognised, that the above code created
stanzas like this in the SVG-file:

<!--Generated by the Batik Graphics2D SVG Generator-->
<defs id="genericDefs"/>
<g>
<g stroke-width="1.5">
<rect fill="none" x="637" width="17" height="15" y="450"/>
</g>
<g fill="rgb(255,0,0)" stroke-width="1.5" fill-opacity="0.251"
stroke-opacity="0.251" stroke="rgb(255,0,0)">
<rect x="637" width="17" height="15" y="450" stroke="none"/>
</g>
</g>

If I could grab this parent-<g>, this would help me a much.

Am I on the wrong track?

Regards,

Keywan

[1] http://version2software.com/v2whiteboard.html
[2] http://www.prometoys.net/downloads/svg/SVGUtil.java






---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message