> This is probably flailing on your part but I think this
> is wrong, since you have added the canvas as a child of the Applet
> Swing should ensure that it gets painted. I'm not sure what the
> impact of adding this call would be...
I had actually multiple rectangles drawn on the canvas. With the previous
code only some of the rectangles were redrawn and there was flickering too.
I changed the following lines of code
// Paint method
public void paint(Graphics g) {
svgCanvas.paintComponent(g);
}
to
public void update(Graphics g) {
paint(g);
}
public synchronized void paint(Graphics g) {
super.paint(g);
}
and now all the rectangles are updated. But flickering is still there.
> oAnimEngine.initStructures(rectDoc, win, screenName);
> This might be your problem. You should get the Document from the
> Canvas rather than remember the document you passed to the canvas. In
> some cases the canvas has to clone the document passed to it so that it
> is using our DOM Implementation. I would think that your parsing code
> would generate a DOM that passes this test but if not this could explain
> your problems (you are changing rectDoc, but the canvas is displaying a
> separate document cloned from rectDoc).
I would have to redesign my whole application if i want to get an SVG
document from canvas each time in
my callback function. My current design parses the svg document initially
and stores references to some
of it's elements. Upon receiving the callback it updates these elements to
perform animation.
Since the rectangles are being redrawn allright, this doesn't seem to be the
problem too. If i am changing
one document and canvas is showing another document, there should be no
animation. For now there IS animation, it just flickers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
View this message in context:
http://www.nabble.com/Require-repaint-in-applet-to-update-canvas-tf4403481.html#a12636495
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]