Package java.awt

Examples of java.awt.Rectangle.intersection()


            }

            if (direction > 0) {
                Rectangle bounds = getCellBounds(getLastVisibleIndex(), getLastVisibleIndex());
                if (bounds != null) {
                    result = visibleRect.height - bounds.intersection(visibleRect).height;
                }
            } else {
                Rectangle bounds = getCellBounds(getFirstVisibleIndex(), getFirstVisibleIndex());
                if (bounds != null) {
                    result = visibleRect.height - bounds.intersection(visibleRect).height;
View Full Code Here


                    result = visibleRect.height - bounds.intersection(visibleRect).height;
                }
            } else {
                Rectangle bounds = getCellBounds(getFirstVisibleIndex(), getFirstVisibleIndex());
                if (bounds != null) {
                    result = visibleRect.height - bounds.intersection(visibleRect).height;
                }
            }

            return result > 0 ? result : visibleRect.height;
        } else if (orientation == SwingConstants.HORIZONTAL) {
View Full Code Here

            if (layoutOrientation == JList.VERTICAL_WRAP || layoutOrientation == JList.HORIZONTAL_WRAP) {
                if (direction > 0) {
                    Rectangle bounds = getCellBounds(getLastVisibleIndex(), getLastVisibleIndex());
                    if (bounds != null) {
                        result = visibleRect.width - bounds.intersection(visibleRect).width;
                    }
                } else {
                    Rectangle bounds = getCellBounds(getFirstVisibleIndex(), getFirstVisibleIndex());
                    if (bounds != null) {
                        result = visibleRect.width - bounds.intersection(visibleRect).width;
View Full Code Here

                        result = visibleRect.width - bounds.intersection(visibleRect).width;
                    }
                } else {
                    Rectangle bounds = getCellBounds(getFirstVisibleIndex(), getFirstVisibleIndex());
                    if (bounds != null) {
                        result = visibleRect.width - bounds.intersection(visibleRect).width;
                    }
                }
            }

            return result > 0 ? result : visibleRect.width;
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

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

    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

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.