Package java.awt

Examples of java.awt.Rectangle.translate()


        int border = drawBorder ? 2 : 0;
        int transX = padX + border - originX;
        int transY = padY + border - originY;

        clipBounds.translate(-transX, -transY);

        // Determine the extent of the clipping region in tile coordinates.
        int txmin, txmax, tymin, tymax;
       
        txmin = XtoTileX(clipBounds.x);
View Full Code Here


        if (sourceIndex < 0 || sourceIndex >= getNumSources()) {
            throw new IllegalArgumentException(JaiI18N.getString("TranslateIntOpImage0"));
        }

        Rectangle r = new Rectangle(sourceRect);
        r.translate(transX, transY);
        return r;
    }

    /**
     * Returns a conservative estimate of the region of a specified
View Full Code Here

        if (sourceIndex < 0 || sourceIndex >= getNumSources()) {
            throw new IllegalArgumentException(JaiI18N.getString("TranslateIntOpImage0"));
        }

        Rectangle r = new Rectangle(destRect);
        r.translate(-transX, -transY);
        return r;
    }
}
View Full Code Here

        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

        Point2D point = layout.transform(bb);    

        context.getGraphicsContext().setColor(Color.BLACK);
       
        Rectangle rect = (Rectangle) context.getVertexShapeTransformer().transform(bb);
        rect.translate((int)point.getX(), (int)point.getY());
       
        int y = (int)rect.getMinY() + VERTEX_PADDING +
            context.getGraphicsContext().getFontMetrics().getAscent();
       
        for(String line : blockPos.get(bb).lines) {
View Full Code Here

        transform.translate(x, y);
        //adjust clip
        if (clip != null) {
            if (clip instanceof Rectangle) {
                Rectangle r = (Rectangle) clip;
                r.translate(x, y);
            } else {
                throw new UnsupportedOperationException();
            }
        }
    }
View Full Code Here

     * @see java.awt.Graphics#clipRect(int, int, int, int)
     */
    public void clipRect(int x, int y, int width, int height) {
        Rectangle r = new Rectangle(x, y, width, height);
        if (transform != null)
            r.translate((int) transform.getTranslateX(), (int) transform.getTranslateY());

        if (clip == null)
            clip = r;
        else if (clip instanceof Rectangle) {
            clip = ((Rectangle) clip).intersection(r);
View Full Code Here

     * @see java.awt.Graphics#setClip(int, int, int, int)
     */
    public void setClip(int x, int y, int width, int height) {
        Rectangle r = new Rectangle(x, y, width, height);
        if (transform != null)
            r.translate((int) transform.getTranslateX(), (int) transform.getTranslateY());
        clip = new Rectangle(x, y, width, height);
    }

    /**
     * @param clip
View Full Code Here

    if (pane.getBorder() != null) {
      ins3 = pane.getBorder().getBorderInsets(pane);
    }

    Rectangle r = pane.getViewportBorderBounds();
    r.translate(-r.x, -r.y);
    r.width -= ins1.left + ins1.right;
    r.width -= ins2.left + ins2.right;
    r.height -= ins1.top + ins1.bottom;
    r.height -= ins2.top + ins2.bottom;
    r.x -= ins2.left;
View Full Code Here

    r.height -= ins1.top + ins1.bottom;
    r.height -= ins2.top + ins2.bottom;
    r.x -= ins2.left;
    r.x -= ins3.left;
    final Point p = pane.getViewport().getViewPosition();
    r.translate(p.x, p.y);
    r = SwingUtilities.convertRectangle(pane.getViewport(), r, pane);
    return r;
  }

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.