Package java.awt

Examples of java.awt.Rectangle.translate()


        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


        if (clip == null) {
            return null;
        }

        Rectangle res = (Rectangle) clip.getBounds().clone();
        res.translate(-Math.round((float)transform.getTranslateX()), -Math.round((float)transform.getTranslateY()));
        return res;
    }

    @Override
    public Color getColor() {
View Full Code Here

        Point location = textKit.getComponent().getLocationOnScreen();
        Rectangle rect = null;
        try {
            rect = textKit.modelToView(getComposedTextParams()
                                       .getComposedTextStart());
            rect.translate(location.x, location.y);
        } catch (BadLocationException e) {
        }
        return rect;
    }
View Full Code Here

        int dx = currentLocation.x - lastPaintPosition.x;
        int dy = currentLocation.y - lastPaintPosition.y;

        Rectangle copyRect = new Rectangle(lastPaintedRect);
        copyRect.translate(dx, dy);
        if (!parentBounds.intersects(copyRect)) {
            resetBlitting();
            return false;
        }
View Full Code Here

    }


    private Rectangle getVisibleBounds() {
        Rectangle result = blitingComponent.getVisibleRect();
        result.translate(blitingComponent.getX(), blitingComponent.getY());

        return result;
    }

    private boolean initialize() {
View Full Code Here

                Rectangle cellRect = table.getCellRect(row, draggedColumn, false);
                Rectangle gridRect = table.getCellRect(row, draggedColumn, true);

                paintBackgroundUnderDraggedCell(g, gridRect);
                cellRect.translate(table.getTableHeader().getDraggedDistance(), 0);
                gridRect.translate(table.getTableHeader().getDraggedDistance(), 0);
                if (clipBounds == null || clipBounds.intersects(gridRect)) {
                    paintCell(g, row, draggedColumn, cellRect, gridRect);
                    paintGrid(g, row, draggedColumn, gridRect);
                }
            }
View Full Code Here

        if (header.getDraggedColumn() != null) {
            int draggedIndex = getColumnIndex(header.getDraggedColumn());
            Rectangle columnRect = header.getHeaderRect(draggedIndex);
            paintBackgroundUnderDraggedCell(g, columnRect);
            columnRect.translate(header.getDraggedDistance(), 0);
            paintColumn(g, header.getDraggedColumn(), clipRect, columnRect, draggedIndex);
        }
    }

    public Dimension getMinimumSize(final JComponent c) {
View Full Code Here

        if (clip == null) {
            return null;
        }

        Rectangle res = (Rectangle) clip.getBounds().clone();
        res.translate(-Math.round((float)transform.getTranslateX()), -Math.round((float)transform.getTranslateY()));
        return res;
    }

    @Override
    public Color getColor() {
View Full Code Here

                        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);
                        }
                        gComp.dispose();
View Full Code Here

        if (clip == null) {
            return null;
        }

        Rectangle res = (Rectangle) clip.getBounds().clone();
        res.translate(-Math.round((float)transform.getTranslateX()), -Math.round((float)transform.getTranslateY()));
        return res;
    }

    @Override
    public Color getColor() {
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.