xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vyang <vy...@apt-cafm.com>
Subject Re: Update Manager Failing
Date Wed, 02 Sep 2009 14:01:26 GMT

I think I've found the problem.  With slower computer canvas double buffering
might be too slow which cause an interruption in the update manager.  

Now with my code below, I'm just wondering if its a good idea/good coding to
put updatemanager runnables inside a swing worker.  The swingworker is used
to display an progress bar only (I believe).  I've read somewhere that the
progress bar should be run under swingutilities runnable.

vyang


vyang wrote:
> 
> Hello,
> 
> I'm having a bit of a problem with update manager failing.  On a faster
> computer there seems to be no problem but on a slower computer update
> manager seems to fail.  It seems like there is an interruption to update
> manager so it fails thus not updating my canvas.  I always thought that
> update managers runnables are put into a queue and gets called when one is
> finished.  
> 
> my code is as follows:
> 
> Vector finalDrawingLayers = drawingLayers;
> Vector finalLayerSetLayers = layerSetLayers;
> 
> SwingWorker worker = new SwingWorker(){
>                 public Object construct() {
>                     try {
>                        
> finalDrawingPanel.getUpdateManager().getUpdateRunnableQueue().invokeAndWait(new
> Runnable(){
>                             public void run() {
>                                 if (!finalIsFirstLoad) {
>                                     updateLayers(finalDrawingLayers);
> //layers to turn off
>                                     updateLayers(finalLayerSetLayers);
> //layers to turn on
>                                 } else {
>                                    
> updateLayersOnLoad(finallayerstorender);
>                                 }
>                             }
>                         });
>                     } catch (InterruptedException ie) {
>                         ie.printStackTrace();
>                     }
>                     
>                     return null;
>                 }
>                 
>                 public void finished() {
>                     renderColoring();
>                 }
>             };
>             
>             worker.start();
> 
> updateLayers and updateLayersOnLoad just iterate through the vector
> turning on/off visibility of the svg element.
> 
> I thought it might be because its using invokeandwait but
> interruptedexception is never thrown.  Could it be because its inside a
> swing worker?
> 
> Any help is much appreciated.  Thanks.
> 
> vyang
> 

-- 
View this message in context: http://www.nabble.com/Update-Manager-Failing-tp25081949p25258154.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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