[josm-dev] Painting

Sebastian Klein bastikln at googlemail.com
Tue Mar 9 20:40:13 GMT 2010


Jiri Klement wrote:
> One of the reason why painting appears slow is the fact that it's done
> in EDT thread. I think there should be special thread for painting.
> EDT will only send request to repaint and copy offscreen buffer to
> screen when it's ready. Painting thread will wait for repaint
> requests. When request arrives it will start painting immediately. 
> If another request arrives during painting, it will wait. If there are
> multiple repaint request after painting is finished, only the last one
> will be processed.

I'm not sure I understand correctly. When a new painting request 
arrives, the user usually wants to see the new stuff as soon as 
possible. So it might be reasonable to abort the painting task that is 
in progress.

Generally this would make it easier to work with large country extracts. 
Sometimes it paints "for ever". If it doesn't paint in EDT, you could 
still set the layer to invisible. Then it aborts painting and you can 
save to disk, change to wireframe view or do other stuff.

I was wondering: Is it save to paint to the Graphics of some component 
from a random thread at a random time?

__

Sebastian




More information about the josm-dev mailing list