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 Tjorven Lauchardt <tl...@newbase.de> on 2004/02/04 13:38:52 UTC
Change doc without repaint
Hi,
thank you for your help with my othe rproblem, I will come back to that
later. Now, I got to a bigger problem:
I want to change the SVG document, that is displayed by a JSVGCanvas.
So, I put the changes in the run-methode of a new runnable, I add to the
runnablequeue of the updatemanager. After that, I want to transform the
canvas like that:
---
JGVTComponent c = (JGVTComponent)getCanvas();
AffineTransform at =
AffineTransform.getTranslateInstance(translation.getX(),
translation.getY());
AffineTransform rt = (AffineTransform)c.getRenderingTransform().clone();
rt.preConcatenate(at);
c.setRenderingTransform(rt);
---
Now, I wich that the state of the document _before_ the transformation
is not painted to the canvas. How can I tell the updatemanager, my
document shall be changed, but not the display?
Thank you very much!
Regards,
Tjorven
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: Change doc without repaint
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tjorven Lauchardt wrote:
> Thomas DeWeese wrote:
>
>> Uhh, so you want the document update and the rendering transform
>> change to be treated 'atomicly' no intervening repaint, correct?
>>
>> If so you have two options:
>> 1) Use the setRenderingTransform(rt, false) before you change
>> the document this will change the rendering transform but
>> not cause a repaint event.
>> 2) Have your runnable implement the
>> batik.bridge.NoRepaintRunable tagging interface (it
>> extends 'Runnable' so you only need to implement the one).
>> The update manager won't check if it needs to repaint after
>> this type of runnable.
>>
> Thank you! In the meantime, I found the NoRepaintInterface, too, and
> this solves my problem. Is one of the two solutions the "better one"?
So the "best" solution is to use 'invokeLater' with a normal
runnnable on the UpdateManager, then have that use
SwingUtilities.invokeAndWait(...) to set the rendering transform
(probably using the two arg setRenderingTrasform). This avoids any
'holes' where an extra rendering could slip in. I don't think
either of the two above is likely to have problems however.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: Change doc without repaint
Posted by Tjorven Lauchardt <tl...@newbase.de>.
Thomas DeWeese wrote:
> Uhh, so you want the document update and the rendering transform
> change to be treated 'atomicly' no intervening repaint, correct?
>
> If so you have two options:
> 1) Use the setRenderingTransform(rt, false) before you change
> the document this will change the rendering transform but
> not cause a repaint event.
> 2) Have your runnable implement the
> batik.bridge.NoRepaintRunable tagging interface (it
> extends 'Runnable' so you only need to implement the one).
> The update manager won't check if it needs to repaint after
> this type of runnable.
>
Thank you! In the meantime, I found the NoRepaintInterface, too, and
this solves my problem. Is one of the two solutions the "better one"?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org
Re: Change doc without repaint
Posted by Thomas DeWeese <Th...@Kodak.com>.
Tjorven Lauchardt wrote:
> thank you for your help with my othe rproblem, I will come back to that
> later. Now, I got to a bigger problem:
> I want to change the SVG document, that is displayed by a JSVGCanvas.
> So, I put the changes in the run-methode of a new runnable, I add to the
> runnablequeue of the updatemanager. After that, I want to transform the
> canvas like that:
> ---
> Now, I wich that the state of the document _before_ the transformation
> is not painted to the canvas. How can I tell the updatemanager, my
> document shall be changed, but not the display?
Uhh, so you want the document update and the rendering transform
change to be treated 'atomicly' no intervening repaint, correct?
If so you have two options:
1) Use the setRenderingTransform(rt, false) before you change
the document this will change the rendering transform but
not cause a repaint event.
2) Have your runnable implement the
batik.bridge.NoRepaintRunable tagging interface (it
extends 'Runnable' so you only need to implement the one).
The update manager won't check if it needs to repaint after
this type of runnable.
> ---------------------------------------------------------------------
> 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