Hi Fernando,
Fernando Mendez wrote:
I have built a reduced program, based in a Batik example, that
reproduces the problematic behavior of our project.
The test itself is done through the actionPerformed method, called when
pressing the test button. Test button should only be pressed once.
I don't know what I am doing wrong, but I think I am missing some basic
step. Follows the broken code:
Yes, this helped a lot. The problem code is this:
UserAgent userAgent = new UserAgentAdapter();
DocumentLoader loader = new DocumentLoader(userAgent);
BridgeContext ctx = new BridgeContext(userAgent, loader);
ctx.setDynamicState(BridgeContext.DYNAMIC);
GVTBuilder builder = new GVTBuilder();
builder.build(ctx, document);
Then when you set the document to the Canvas another BridgeContext
and loader etc are associated with the document. Thus when an element
is added moved etc, it is in fact added twice to the GVT tree (once
for each attached BridgeContext), but the BridgeContexts keep stepping
on each other.
The simplest thing to do is simply to remove the above code.
However I suspect that in the larger system this code is used so
you can access the SVG DOM for the document. If this is the case
you have two options.
1) simply set the document on the JSVGCanvas and wait for the onload
event to fire, at which point the SVG DOM will be active.
2) you can call 'ctx.dispose()' before you associated the DOM with
the canvas.
#1 is preferable as it will avoid building the GVT tree multiple
times, but #2 will work.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]