Package java.awt

Examples of java.awt.Rectangle.intersection()


        // 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

        // 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

                    if (gComp != null) {
                        Rectangle bounds = comp.getBounds();
                        int x = bounds.x;
                        int y = bounds.y;
                        if (clipBounds != null) {
                            bounds = bounds.intersection(clipBounds);
                        }
                        bounds.translate(-x, -y);
                        gComp.clipRect(bounds.x, bounds.y, bounds.width, bounds.height);
                        if (!gComp.getClipBounds().isEmpty()) {
                            comp.paint(gComp);
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

            } 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.