Java 类sun.awt.image.FileImageSource 实例源码

项目:libbluray    文件:BDToolkitBase.java   
public Image createImage(String filename) {
    if (BDJXletContext.getCurrentContext() == null) {
        logger.error("createImage(): no context " + Logger.dumpStack());
    }

    if (!new File(filename).isAbsolute()) {
        String home = BDJXletContext.getCurrentXletHome();
        if (home != null) {
            String homeFile = home + filename;
            if (new File(homeFile).exists()) {
                logger.warning("resource translated to " + homeFile);
                filename = homeFile;
            } else {
                logger.error("resource " + homeFile + " does not exist");
            }
        }
    }

    ImageProducer ip = new FileImageSource(filename);
    Image newImage = createImage(ip);
    return newImage;
}
项目:openjdk-jdk10    文件:SunToolkit.java   
static Image getImageFromHash(Toolkit tk,
                                           String filename) {
    checkPermissions(filename);
    synchronized (fileImgCache) {
        Image img = (Image)fileImgCache.get(filename);
        if (img == null) {
            try {
                img = tk.createImage(new FileImageSource(filename));
                fileImgCache.put(filename, img);
            } catch (Exception e) {
            }
        }
        return img;
    }
}
项目:openjdk9    文件:SunToolkit.java   
static Image getImageFromHash(Toolkit tk,
                                           String filename) {
    checkPermissions(filename);
    synchronized (fileImgCache) {
        Image img = (Image)fileImgCache.get(filename);
        if (img == null) {
            try {
                img = tk.createImage(new FileImageSource(filename));
                fileImgCache.put(filename, img);
            } catch (Exception e) {
            }
        }
        return img;
    }
}
项目:openjdk-jdk10    文件:SunToolkit.java   
@Override
public Image createImage(String filename) {
    checkPermissions(filename);
    return createImage(new FileImageSource(filename));
}
项目:openjdk9    文件:SunToolkit.java   
@Override
public Image createImage(String filename) {
    checkPermissions(filename);
    return createImage(new FileImageSource(filename));
}
项目:libbluray    文件:HBackgroundImage.java   
public HBackgroundImage(String filename) {
    producer = new FileImageSource(filename);
    img = Toolkit.getDefaultToolkit().createImage(producer);
}