You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by John Pritchard <jd...@syntelos.com> on 2009/03/18 17:53:03 UTC

media/Image#load

Hi,

Shouldn't
Image.load(url)

hit the application context resource cache?

(so one doesn't need to write things like

    private static Image Away, Busy, Offline, Online, Trash;
    static {
        ApplicationContext.ResourceCacheDictionary cache =
ApplicationContext.getResourceCache();

        Class clas = Applet.class;
        URL url;
        url = clas.getResource("user-away.png");
        if (!cache.containsKey(url)){
            Away = Image.load(url);
            cache.put(url,Away);
        }
        else
            Away = (Image)cache.get(url);


/john/

Re: media/Image#load

Posted by John Pritchard <jd...@syntelos.com>.
> >Shouldn't
> >Image.load(url)
> >
> >hit the application context resource cache?
>
> I don't think so, because it may not be safe to assume that all callers
> actually want to cache images loaded by this method.
>
>
yea, I thought about that for a minute.. like it always surprises me when
many instances of an animated icon are in synch in the browser..

Re: media/Image#load

Posted by Greg Brown <gk...@mac.com>.
>Shouldn't
>Image.load(url)
>
>hit the application context resource cache?

I don't think so, because it may not be safe to assume that all callers actually want to cache images loaded by this method.