FileDocCategorySizeDatePackage
ImageLoader.javaAPI DocAndroid 1.5 API1840Wed May 06 22:41:08 BST 2009com.android.ddmuilib

ImageLoader

public class ImageLoader extends Object implements IImageLoader
Image loader for an normal standalone app.

Fields Summary
private Class
mClass
class used as reference to get the reources
Constructors Summary
public ImageLoader(Class theClass)
Creates a loader for a specific class. The class allows java to figure out which .jar file to search for the image.

param
theClass

        mClass = theClass;
    
Methods Summary
public org.eclipse.jface.resource.ImageDescriptorloadDescriptor(java.lang.String filename, org.eclipse.swt.widgets.Display display)

        // we don't support ImageDescriptor
        return null;
    
public org.eclipse.swt.graphics.ImageloadImage(java.lang.String filename, org.eclipse.swt.widgets.Display display)


        String tmp = "/images/" + filename;
        InputStream imageStream = mClass.getResourceAsStream(tmp);

        if (imageStream != null) {
            Image img = new Image(display, imageStream);
            if (img == null)
                throw new NullPointerException("couldn't load " + tmp);
            return img;
        }

        return null;