Package java.awt

Examples of java.awt.Rectangle.intersects()


         // Paint upper thumb first, then lower thumb.
         if (clipRect.intersects(this._upperThumbRect_))
         {
            paintUpperThumb(g);
         }
         if (clipRect.intersects(thumbRect))
         {
            paintLowerThumb(g);
         }
      }
   }
View Full Code Here


    /**
     * Draws a sprite, if it is in the current view
     */
    private final void drawSprite(Graphics g, Sprite sprite) {
        Rectangle view = g.getClipBounds();
        if (view.intersects(sprite.getBounds()) && !sprite.hidden) {
            if (!sprite.isReady()) {
                sprite.prepare();
            }
            sprite.drawOnto(g, sprite.getBounds().x, sprite.getBounds().y, this);
        }
View Full Code Here

        Rectangle clipRect = g.getClipBounds();
        if (clipRect != null) {
            for (int i = 0; i < list.getModel().getSize(); i++) {
                Rectangle bounds = layouter.getLayoutStrategy().getBounds(i);
                if (bounds.intersects(clipRect)) {
                    paintCell(g, i, bounds, list.getCellRenderer(), list.getModel(), list.getSelectionModel(), i);
                }
            }
        } else {
            for (int i = 0; i < list.getModel().getSize(); i++) {
View Full Code Here

                Rectangle titleRect = new Rectangle(x + titleLeftInset - 1,
                                                    y - stringHeight + titleTopInset - TEXT_SPACING,
                                                    stringWidth + TEXT_SPACING,
                                                    stringHeight + 2*TEXT_SPACING);

                if (titleRect.intersects(g.getClipBounds())) {
                    Rectangle[] difference = SwingUtilities.computeDifference(g.getClipBounds(), titleRect);
                    MultiRectArea clipArea = new MultiRectArea(difference);
                    g.setClip(clipArea);
                }
            }
View Full Code Here

        ComponentOrientation co = getComponentOrientation();
        if (co.isHorizontal()) {
            for (int i = model.getSize() - 1; i >= 0; i--) {
                Rectangle bounds = getCellBounds(i, i);
                if (bounds.intersects(visibleRect)) {
                    return i;
                }
            }
        }
View Full Code Here

        ComponentOrientation co = getComponentOrientation();
        if (co.isHorizontal()) {
            for (int i = 0; i < model.getSize(); i++) {
                Rectangle bounds = getCellBounds(i, i);
                if (bounds.intersects(visibleRect)) {
                    return i;
                }
            }
        }
View Full Code Here

        if (cm.hasAlpha()) {
            // 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;
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);
View Full Code Here

        CachableRed src = (CachableRed)getSources().get(0);

        Rectangle srcR = src.getBounds();
        Rectangle wrR  = wr.getBounds();

        if (wrR.intersects(srcR)) {
            Rectangle r = wrR.intersection(srcR);
       
            // Limit the raster I send to my source to his rect.
            WritableRaster srcWR;
            srcWR = wr.createWritableChild(r.x, r.y, r.width, r.height,
View Full Code Here

        // Don't try and get data from src that it doesn't have...
        CachableRed src = (CachableRed)getSources().get(0);

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

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

        if (srcRas == null)
            return;
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.