类sun.awt.image.ToolkitImage源码实例Demo

下面列出了怎么用sun.awt.image.ToolkitImage的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码2 项目: hottub   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码3 项目: dragonwell8_jdk   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
源代码4 项目: openjdk-8   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码5 项目: dragonwell8_jdk   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码6 项目: Bytecoder   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码7 项目: jdk8u-dev-jdk   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码8 项目: TencentKona-8   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码9 项目: Bytecoder   文件: SunToolkit.java
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
    if (w == 0 || h == 0) {
        return true;
    }

    // Must be a ToolkitImage
    if (!(img instanceof ToolkitImage)) {
        return true;
    }

    ToolkitImage tkimg = (ToolkitImage)img;
    if (tkimg.hasError()) {
        if (o != null) {
            o.imageUpdate(img, ImageObserver.ERROR|ImageObserver.ABORT,
                          -1, -1, -1, -1);
        }
        return false;
    }
    ImageRepresentation ir = tkimg.getImageRep();
    return ir.prepare(o) & prepareResolutionVariant(img, w, h, o);
}
 
源代码10 项目: openjdk-8-source   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码11 项目: TencentKona-8   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码12 项目: jdk8u60   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码13 项目: jdk8u-jdk   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码14 项目: jdk8u-jdk   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码15 项目: hottub   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码16 项目: openjdk-jdk8u   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码17 项目: openjdk-jdk9   文件: PathGraphics.java
protected BufferedImage getBufferedImage(Image img) {
    if (img instanceof BufferedImage) {
        // Otherwise we expect a BufferedImage to behave as a standard BI
        return (BufferedImage)img;
    } else if (img instanceof ToolkitImage) {
        // This can be null if the image isn't loaded yet.
        // This is fine as in that case our caller will return
        // as it will only draw a fully loaded image
        return ((ToolkitImage)img).getBufferedImage();
    } else if (img instanceof VolatileImage) {
        // VI needs to make a new BI: this is unavoidable but
        // I don't expect VI's to be "huge" in any case.
        return ((VolatileImage)img).getSnapshot();
    } else {
        // may be null or may be some non-standard Image which
        // shouldn't happen as Image is implemented by the platform
        // not by applications
        // If you add a new Image implementation to the platform you
        // will need to support it here similarly to VI.
        return null;
    }
}
 
源代码18 项目: jdk8u-jdk   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
源代码19 项目: openjdk-jdk9   文件: SunToolkit.java
@Override
public boolean prepareImage(Image img, int w, int h, ImageObserver o) {
    if (w == 0 || h == 0) {
        return true;
    }

    // Must be a ToolkitImage
    if (!(img instanceof ToolkitImage)) {
        return true;
    }

    ToolkitImage tkimg = (ToolkitImage)img;
    if (tkimg.hasError()) {
        if (o != null) {
            o.imageUpdate(img, ImageObserver.ERROR|ImageObserver.ABORT,
                          -1, -1, -1, -1);
        }
        return false;
    }
    ImageRepresentation ir = tkimg.getImageRep();
    return ir.prepare(o) & prepareResolutionVariant(img, w, h, o);
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码21 项目: openjdk-jdk8u-backup   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
源代码23 项目: openjdk-jdk9   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码24 项目: openjdk-8-source   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
源代码25 项目: Bytecoder   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                          int dx1, int dy1, int dx2, int dy2,
                          int sx1, int sy1, int sx2, int sy2,
                          Color bgColor,
                          ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, dx1, dy1, dx2, dy2,
                          sx1, sy1, sx2, sy2, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, dx1, dy1, dx2, dy2,
                                 sx1, sy1, sx2, sy2, bgColor, observer);
    }
}
 
源代码26 项目: Bytecoder   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int dx, int dy, int sx, int sy, int w, int h,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, dx, dy, sx, sy, w, h, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg,
                                 dx, dy, (dx + w), (dy + h),
                                 sx, sy, (sx + w), (sy + h),
                                 bgColor, observer);
    }
}
 
源代码27 项目: Bytecoder   文件: DrawImage.java
public boolean scaleImage(SunGraphics2D sg, Image img,
                            int x, int y,
                            int width, int height,
                            Color bgColor,
                            ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return scaleImage(sg, img, x, y, width, height, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, width, height, bgColor,
                                 observer);
    }
}
 
源代码28 项目: dragonwell8_jdk   文件: DrawImage.java
public boolean copyImage(SunGraphics2D sg, Image img,
                         int x, int y,
                         Color bgColor,
                         ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        return copyImage(sg, img, x, y, bgColor);
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, x, y, bgColor, observer);
    }
}
 
源代码29 项目: dragonwell8_jdk   文件: IconInfo.java
public IconInfo(Image image) {
    this.image = image;
    if (image instanceof ToolkitImage) {
        ImageRepresentation ir = ((ToolkitImage)image).getImageRep();
        ir.reconstruct(ImageObserver.ALLBITS);
        this.width = ir.getWidth();
        this.height = ir.getHeight();
    } else {
        this.width = image.getWidth(null);
        this.height = image.getHeight(null);
    }
    this.scaledWidth = width;
    this.scaledHeight = height;
    this.rawLength = width * height + 2;
}
 
源代码30 项目: TencentKona-8   文件: DrawImage.java
public boolean transformImage(SunGraphics2D sg, Image img,
                              AffineTransform atfm,
                              ImageObserver observer) {
    if (!(img instanceof ToolkitImage)) {
        transformImage(sg, img, 0, 0, atfm, sg.interpolationType);
        return true;
    } else {
        ToolkitImage sunimg = (ToolkitImage)img;
        if (!imageReady(sunimg, observer)) {
            return false;
        }
        ImageRepresentation ir = sunimg.getImageRep();
        return ir.drawToBufImage(sg, sunimg, atfm, observer);
    }
}
 
 类所在包
 类方法
 同包方法