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

项目:OpenJSharp    文件: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);
    }
}
项目:OpenJSharp    文件: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);
    }
}
项目:OpenJSharp    文件: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);
    }
}
项目:OpenJSharp    文件: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;
    }
}
项目: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);
    }
}
项目:jdk8u-jdk    文件: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);
    }
}
项目: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);
    }
}
项目:jdk8u-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;
    }
}
项目:openjdk-jdk10    文件: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);
    }
}
项目:openjdk-jdk10    文件: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);
    }
}
项目:openjdk-jdk10    文件: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);
    }
}
项目:openjdk-jdk10    文件: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;
    }
}
项目:openjdk-jdk10    文件: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);
}
项目:openjdk9    文件: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);
    }
}
项目:openjdk9    文件: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);
    }
}
项目:openjdk9    文件: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);
    }
}
项目:openjdk9    文件: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;
    }
}
项目:openjdk9    文件: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);
}
项目:erp    文件:FRBoleto.java   
private HashMap<String, Object> getParametros() {

        HashMap<String, Object> parametros = new HashMap<String, Object>();
        Empresa empresa = new Empresa( con );
        parametros.put( "CODEMP", Aplicativo.iCodEmp );
        parametros.put( "CODFILIAL", ListaCampos.getMasterFilial( "FNITRECEBER" ) );
        parametros.put( "IMPDOC", txtImpInst.getVlrString() );
        parametros.put( "TPNOSSONUMERO", tpnossonumero );
        parametros.put( "IMPDOCBOL", impdocbol );

        if ( Aplicativo.empresa != null ) {
            parametros.put( "RAZEMP", empresa.getAll().get( "RAZEMP" ) );
            ToolkitImage logoemp = (ToolkitImage) empresa.getAll().get( "LOGOEMP" );
            if ( logoemp != null ) {
                parametros.put( "LOGOEMP", logoemp );
            }
        }
        // parametros.put( "CODVENDA", txtCodVenda.getVlrInteger() );

        return parametros;
    }
项目: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);
    }
}
项目:jdk8u_jdk    文件: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);
    }
}
项目: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);
    }
}
项目:jdk8u_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;
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件: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;
    }
}
项目:infobip-open-jdk-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);
    }
}
项目:infobip-open-jdk-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);
    }
}
项目:infobip-open-jdk-8    文件: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);
    }
}
项目:infobip-open-jdk-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;
    }
}
项目: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);
    }
}
项目:jdk8u-dev-jdk    文件: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);
    }
}
项目:jdk8u-dev-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);
    }
}
项目:jdk8u-dev-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;
    }
}
项目:jdk7-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);
    }
}
项目:jdk7-jdk    文件: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);
    }
}
项目:jdk7-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);
    }
}
项目:jdk7-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;
    }
}
项目:openjdk-source-code-learn    文件: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);
    }
}