Package java.awt.image.renderable

Examples of java.awt.image.renderable.RenderableImage


            Vector v = comp.getSources();
            if (v == null) return true;
            ListIterator li = v.listIterator(v.size());
            while (li.hasPrevious()) {
                RenderableImage csrc = (RenderableImage)li.previous();
                if (!allPaintRable(csrc)) {
                    li.next();
                    break;
                }
            }
View Full Code Here


    public Object getProperty(String name) {
        Object ret = props.get(name);
        if (ret != null) return ret;
        Iterator i = srcs.iterator();
        while (i.hasNext()) {
            RenderableImage ri = (RenderableImage)i.next();
            ret = ri.getProperty(name);
            if (ret != null) return ret;
        }
        return null;
    }
View Full Code Here

            ret[i++] = (String)iter.next();
        }

        iter = srcs.iterator();
        while (iter.hasNext()) {
            RenderableImage ri = (RenderableImage)iter.next();
            String [] srcProps = ri.getPropertyNames();
            if (srcProps.length != 0) {
                String [] tmp = new String[ret.length+srcProps.length];
                System.arraycopy(tmp,0,tmp,0,ret.length);
                System.arraycopy(tmp,ret.length,srcProps,0,srcProps.length);
                ret = tmp;
View Full Code Here

        // No sources and we are PaintRable so the chain is PaintRable.
        if (v == null) return true;
       
        Iterator i = v.iterator();
        while (i.hasNext()) {
            RenderableImage nri = (RenderableImage)i.next();
            // A source is not paintRable so we are not 100% paintRable.
            if (!allPaintRable(nri)) return false;
        }
       
        return true;
View Full Code Here

            Vector v = comp.getSources();
            if (v == null) return true;
            ListIterator li = v.listIterator(v.size());
            while (li.hasPrevious()) {
                RenderableImage csrc = (RenderableImage)li.previous();
                if (!allPaintRable(csrc)) {
                    li.next();
                    break;
                }
            }
View Full Code Here

    public Object getProperty(String name) {
        Object ret = props.get(name);
        if (ret != null) return ret;
        Iterator i = srcs.iterator();
        while (i.hasNext()) {
            RenderableImage ri = (RenderableImage)i.next();
            ret = ri.getProperty(name);
            if (ret != null) return ret;
        }
        return null;
    }
View Full Code Here

            ret[i++] = (String)iter.next();
        }

        iter = srcs.iterator();
        while (iter.hasNext()) {
            RenderableImage ri = (RenderableImage)iter.next();
            String [] srcProps = ri.getPropertyNames();
            if (srcProps.length != 0) {
                String [] tmp = new String[ret.length+srcProps.length];
                System.arraycopy(ret,0,tmp,0,ret.length);
                System.arraycopy(tmp,ret.length,srcProps,0,srcProps.length);
                ret = tmp;
View Full Code Here

        // No sources and we are PaintRable so the chain is PaintRable.
        if (v == null) return true;

        Iterator i = v.iterator();
        while (i.hasNext()) {
            RenderableImage nri = (RenderableImage)i.next();
            // A source is not paintRable so we are not 100% paintRable.
            if (!allPaintRable(nri)) return false;
        }

        return true;
View Full Code Here

            List v = comp.getSources();
            if (v == null) return true;
            ListIterator li = v.listIterator(v.size());
            while (li.hasPrevious()) {
                RenderableImage csrc = (RenderableImage)li.previous();
                if (!allPaintRable(csrc)) {
                    li.next();
                    break;
                }
            }
View Full Code Here

                    scaleY = filterResolutionY / (float)devRect.height;
                }
               
                // Only resample if either scaleX or scaleY is
                // smaller than 1
                RenderableImage localSource = getSource();
                RenderContext localRenderContext = renderContext;
               
                if((scaleX < 1) || (scaleY < 1)){
                    // System.out.println("filterRes X " + filterResolutionX +
                    //                    " Y : " + filterResolutionY);

                    scaleX = scaleX < scaleY ? scaleX : scaleY;
                    scaleY = scaleX;

                    //
                    // Create a rendering that will be less than
                    // or equal to filterResolutionX by filterResolutionY.
                    //
                    AffineTransform newUsr2Dev
                        = AffineTransform.getScaleInstance(scaleX, scaleY);
                   
                    newUsr2Dev.concatenate(usr2dev);
                   
                    //
                    // Create a new RenderingContext
                    //
                    RenderContext newRenderContext
                        = (RenderContext)renderContext.clone();
                    newRenderContext.setTransform(newUsr2Dev);

                    Shape aoi = renderContext.getAreaOfInterest();
                    if (aoi == null)
                        aoi = getBounds2D();
                   
                    //
                    // We need to grow the area of interest by a few
                    // pixels in device space so the AffineRed can
                    // interpolate at the edges..
                    //
                    Rectangle2D newAOI = aoi.getBounds2D();
                    newAOI = new Rectangle2D.Double
                        (newAOI.getX()-1/scaleX,
                         newAOI.getY()-1/scaleY,
                         newAOI.getWidth()+2/scaleX,
                         newAOI.getHeight()+2/scaleY);

                    newRenderContext.setAreaOfInterest(newAOI);

                    //
                    // Now, use an AffineRable that will apply the
                    // resampling
                    //
                    AffineTransform resampleTxf
                        = AffineTransform.getScaleInstance(1/scaleX, 1/scaleY);
                   
                    RenderedImage result = null;
                    result = localSource.createRendering(newRenderContext);
                    if (result != null)
                        result = new AffineRed
                            (GraphicsUtil.wrap(result),
                             resampleTxf, renderContext.getRenderingHints());

                    return result;
                }

                return localSource.createRendering(localRenderContext);
            }
        }

        return null;
    }
View Full Code Here

TOP

Related Classes of java.awt.image.renderable.RenderableImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.