Package java.awt

Examples of java.awt.Rectangle.intersection()


            int xloc = curr.getXLoc() * workTileWidth + tileGridXOff;
            int yloc = curr.getYLoc() * workTileHeight + tileGridYOff;
            Rectangle tb = new Rectangle( xloc, yloc,
                    curr.getWidth() * workTileWidth,
                    curr.getHeight() * workTileHeight );
            tb = tb.intersection( bounds );

            WritableRaster child =
                    wr.createWritableChild( tb.x, tb.y, tb.width, tb.height,
                            tb.x, tb.y, null );
            // System.out.println("Computing : " + child);
View Full Code Here


    public Raster getData(Rectangle rect) {
        Rectangle r = (Rectangle)rect.clone();

        if ( ! r.intersects(getBounds()) )
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
View Full Code Here

        // Already has alpha channel so we use it.
        srcRed.copyData(wr);

        Rectangle rgn = wr.getBounds();
        rgn = rgn.intersection(alphaRed.getBounds());

        Raster r = alphaRed.getData(rgn);

        ComponentSampleModel csm;
        csm = (ComponentSampleModel)r.getSampleModel();
View Full Code Here

            // Already has alpha channel so we use it.
            srcRed.copyData(wr);

            Rectangle rgn = wr.getBounds();
            if (rgn.intersects(alphaRed.getBounds()))
                rgn = rgn.intersection(alphaRed.getBounds());
            else
                return wr;

            int [] wrData    = null;
            int [] alphaData = null;
View Full Code Here

                                       bands);

        srcRed.copyData(subWr);

        Rectangle rgn = wr.getBounds();
        rgn = rgn.intersection(alphaRed.getBounds());


        bands = new int [] { wr.getNumBands()-1 };
        subWr = wr.createWritableChild(rgn.x,     rgn.y,
                                       rgn.width, rgn.height,
View Full Code Here

      int xloc = curr.getXLoc()*tileWidth +tileGridXOff;
      int yloc = curr.getYLoc()*tileHeight+tileGridYOff;
      Rectangle tb = new Rectangle(xloc, yloc,
           curr.getWidth()*tileWidth,
           curr.getHeight()*tileHeight);
      tb = tb.intersection(bounds);
      Point loc = new Point(tb.x, tb.y);
      WritableRaster child = Raster.createPackedRaster
    (dbi, tb.width, tb.height, tb.width, masks, loc);
      genRect(child);
      if (use_INT_PACK) GraphicsUtil.copyData_INT_PACK(child, wr);
View Full Code Here

      int xloc = curr.getXLoc()*tileWidth +tileGridXOff;
      int yloc = curr.getYLoc()*tileHeight+tileGridYOff;
      Rectangle tb = new Rectangle(xloc, yloc,
           curr.getWidth()*tileWidth,
           curr.getHeight()*tileHeight);
      tb = tb.intersection(bounds);

      WritableRaster child =
    wr.createWritableChild(tb.x, tb.y, tb.width, tb.height,
               tb.x, tb.y, null);
      // System.out.println("Computing : " + child);
View Full Code Here

    public Raster getData(Rectangle rect) {
        Rectangle r = (Rectangle)rect.clone();

        if (r.intersects(getBounds()) == false)
            return null;
        r = r.intersection(getBounds());
        r.translate(-getMinX(), - getMinY());

        Raster ret = bi.getData(r);
        return ret.createTranslatedChild(ret.getMinX()+getMinX(),
                                         ret.getMinY()+getMinY());
View Full Code Here

        // Raster srcRas = src.getData(srcR);

        if (srcR.intersects(src.getBounds()) == false)
            return;
        Raster srcRas = src.getData(srcR.intersection(src.getBounds()));

        if (srcRas == null)
            return;

        // This works around the problem that the buffered ops
View Full Code Here

            } else {
                clipR   = clip.getBounds();

                if (clipR.intersects(crR) == false)
                    return; // Nothing to draw...
                clipR = clipR.intersection(crR);
            }

            Rectangle gcR = getDestinationBounds(g2d);
            // System.out.println("ClipRects: " + clipR + " -> " + gcR);
            if (gcR != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.