xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pepping, Florian" <florian.pepp...@wincor-nixdorf.com>
Subject RE: UpdateManager thread not refreshing dynamic svg in JSVGCanvas
Date Wed, 07 Mar 2007 06:59:37 GMT
Hi Tacio,

I don't see any line of code where you are adding the created Element to
your document. Try adding something like this to your code:
root.appendChild(rectangle);

Than it should work, the rest looks ok.

Good luck and have fun

Florian

-----Original Message-----
From: Tacio Santos [mailto:tacio.santos@gmail.com] 
Sent: Wednesday, March 07, 2007 6:21 AM
To: batik-users@xmlgraphics.apache.org
Subject: UpdateManager thread not refreshing dynamic svg in JSVGCanvas

Hi,

I'm new to batik and to svg. I'm trying to dynamically add elements to
a JSVGCanvas but updates are not been displayed. I went throgh the FAQ
and the mailing list archives( from 200501 to 200703) but I haven't
found a hint to my problem. Does anybody know what am I missing or
mistaking in the code below?

Thanks in advance,
Tacio

PS:

canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
canvas.setURI( MY_SVG_FILE );
..
// after gvtRenderingCompleted event I'm doing:

canvas.getUpdateManager().getUpdateRunnableQueue()
		.invokeLater(
				new Runnable() {
					public void run() {

						SVGDocument doc =
canvas.getSVGDocument();
						SVGSVGElement root
=doc.getRootElement();
						String
svgNS="http://www.w3.org/2000/svg";
						Element rectangle =
doc.createElementNS(svgNS, "rect");
	
rectangle.setAttributeNS(null, "x", "200");
	
rectangle.setAttributeNS(null, "y", "200" );
	
rectangle.setAttributeNS(null, "width", "100");
	
rectangle.setAttributeNS(null, "height", "510");
                  }
            );

PS2: My system

BATIK version 1.6

JAVA:

java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_10-b03, mixed mode)

OS:
Debian GNU/Linux 4.0 (etch)
Linux  2.6.18-3-amd64  SMP x86_64

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


---------------------------------------------------------------------
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