You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by LCID Fire <lc...@gmx.net> on 2010/06/09 22:05:35 UTC

Synchronous drawing

I recently switched from SVGSalamander to Batik due to the css support 
it has. Now I face a serious problem with the way Batik is asynchronous 
painting the Component. I have multiple Components layered via 
JLayeredPanel. For the case where a lower SVG takes longer to be drawn 
than an upper one these layers get mixed together and the gui gets 
scrambled. So my question is: Is there a way to make the painting 
synchronous?

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


Re: Synchronous drawing

Posted by th...@kodak.com.
Hi LCID,

LCID Fire <lc...@gmx.net> wrote on 06/15/2010 06:48:27 AM:

> On 06/15/2010 12:37 PM, thomas.deweese@kodak.com wrote:
> >          There is no simple way to make the painting synchronous.
> > You could probably subclass the canvas and add synchronizing code
> > so that none of the canvas updates could complete until they were
> > all ready to go.

> I tried something similar but it got really complicated really fast 
> (especially since Batik DOES sync with Swing threads for it's 
> Listeners).

        Hmm, did you try merging all of the document's into one
with 'image' elements?  That would force the drawing to be 
synchronous between 'images'.


Re: Synchronous drawing

Posted by LCID Fire <lc...@gmx.net>.
On 06/15/2010 12:37 PM, thomas.deweese@kodak.com wrote:
> Hi Lcid,
>
> LCID Fire<lc...@gmx.net>  wrote on 06/09/2010 04:05:35 PM:
>
>> I recently switched from SVGSalamander to Batik due to the css support
>> it has. Now I face a serious problem with the way Batik is asynchronous
>> painting the Component. I have multiple Components layered via
>> JLayeredPanel. For the case where a lower SVG takes longer to be drawn
>> than an upper one these layers get mixed together and the gui gets
>> scrambled. So my question is: Is there a way to make the painting
>> synchronous?
>
>          There is no simple way to make the painting synchronous.
> You could probably subclass the canvas and add synchronizing code
> so that none of the canvas updates could complete until they were
> all ready to go.
I tried something similar but it got really complicated really fast 
(especially since Batik DOES sync with Swing threads for it's 
Listeners). Since having no other way to go I now convert all SVGs to 
PNG - which is kind of contra productive to begin with. I'll probably 
just have to rip out all SVG support alltogether again :(
Shame really.

Thanks for answering


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


Re: Synchronous drawing

Posted by th...@kodak.com.
Hi Lcid,

LCID Fire <lc...@gmx.net> wrote on 06/09/2010 04:05:35 PM:

> I recently switched from SVGSalamander to Batik due to the css support 
> it has. Now I face a serious problem with the way Batik is asynchronous 
> painting the Component. I have multiple Components layered via 
> JLayeredPanel. For the case where a lower SVG takes longer to be drawn 
> than an upper one these layers get mixed together and the gui gets 
> scrambled. So my question is: Is there a way to make the painting 
> synchronous?

        There is no simple way to make the painting synchronous.
You could probably subclass the canvas and add synchronizing code
so that none of the canvas updates could complete until they were 
all ready to go.