File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes GWT and the fly likes GWT load images - wait & notify or lock & unlock mechanism is needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT load images - wait & notify or lock & unlock mechanism is needed" Watch "GWT load images - wait & notify or lock & unlock mechanism is needed" New topic
Author

GWT load images - wait & notify or lock & unlock mechanism is needed

Shahar Muky
Greenhorn

Joined: May 19, 2011
Posts: 7
Hi

I have a GWT application where I'm loading lot of images and soon after I am drawing part of them into a canvas.
The problem is that the images are loading asynchronously and I can't be sure that there are available for use use later own in the code.

The solutions to use onImageLoad, is insufficient for my application because that at this time, I have no idea how will the application use them.

The best way for me would be to use some wait/notify or lock/unlock mechanism together with the onImageLoad, but I couldn't find any sample of such mechanism (or similar).

any Idea?

P.S - I prefer a solution from the official GWT SDK and not an extension (or at least a very small one).

Thanks
Muky.

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10372
    
    8

Why are you concerned if the image is fully loaded in your code later? Browsers are smart enough to figure that out aren't they?
If your images are static, have you considered using ClientBundle?
Edit: Corrected url tags


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Shahar Muky
Greenhorn

Joined: May 19, 2011
Posts: 7
Thanks, that helped a lot.

Also the post on: http://comments.gmane.org/gmane.org.google.gwt/59017
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GWT load images - wait & notify or lock & unlock mechanism is needed