Package java.awt

Examples of java.awt.Graphics.translate()


        public void runTest(Object ctx, int numReps) {
            ImageTests.Context ictx = (ImageTests.Context) ctx;
            int x = ictx.initX;
            int y = ictx.initY;
            Graphics g = ictx.graphics;
            g.translate(ictx.orgX, ictx.orgY);
            Image src = ictx.src;
            if (ictx.animate) {
                do {
                    g.drawImage(src, x, y, null);
                    if ((x -= 3) < 0) x += ictx.maxX;
View Full Code Here


            } else {
                do {
                    g.drawImage(src, x, y, null);
                } while (--numReps > 0);
            }
            g.translate(-ictx.orgX, -ictx.orgY);
        }
    }

    public static class DrawImageBg extends ImageTests {
        public DrawImageBg() {
View Full Code Here

        public void runTest(Object ctx, int numReps) {
            ImageTests.Context ictx = (ImageTests.Context) ctx;
            int x = ictx.initX;
            int y = ictx.initY;
            Graphics g = ictx.graphics;
            g.translate(ictx.orgX, ictx.orgY);
            Image src = ictx.src;
            Color bg = Color.orange;
            if (ictx.animate) {
                do {
                    g.drawImage(src, x, y, bg, null);
View Full Code Here

            } else {
                do {
                    g.drawImage(src, x, y, bg, null);
                } while (--numReps > 0);
            }
            g.translate(-ictx.orgX, -ictx.orgY);
        }
    }

    public static class DrawImageScale extends ImageTests {
        float scale;
View Full Code Here

            int x = ictx.initX;
            int y = ictx.initY;
            int w = ictx.outdim.width;
            int h = ictx.outdim.height;
            Graphics g = ictx.graphics;
            g.translate(ictx.orgX, ictx.orgY);
            Image src = ictx.src;
            if (ictx.animate) {
                do {
                    g.drawImage(src, x, y, w, h, null);
                    if ((x -= 3) < 0) x += ictx.maxX;
View Full Code Here

            } else {
                do {
                    g.drawImage(src, x, y, w, h, null);
                } while (--numReps > 0);
            }
            g.translate(-ictx.orgX, -ictx.orgY);
        }
    }

    public static class DrawImageTransform extends ImageTests {
        public DrawImageTransform() {
View Full Code Here

            GraphicsTests.Context gctx = (GraphicsTests.Context)ctx;
            int size = gctx.size;
            int x = gctx.initX;
            int y = gctx.initY;
            Graphics g = gctx.graphics;
            g.translate(gctx.orgX, gctx.orgY);
            if (gctx.animate) {
                do {
                    g.copyArea(x, y, size, size, dx, dy);
                    if ((x -= 3) < 0) x += gctx.maxX;
                    if ((y -= 1) < 0) y += gctx.maxY;
View Full Code Here

                clipRect.width + 1, clipRect.height + 1);
        if (image == null) {
            return;
        }
        Graphics offscreenGraphics = image.getGraphics();
        offscreenGraphics.translate(-clipRect.x, -clipRect.y);
        offscreenGraphics.setClip(clipRect);
        doubleBufferingRoot = true;
        try {
            paint(getComponentGraphics(offscreenGraphics));
            g.drawImage(image, clipRect.x, clipRect.y, this);
View Full Code Here

            }
           
            Graphics g = externalFrame.getGraphics();
            g.clearRect(0, 0, 200, 200);
            externalFrame.paint(g);
            g.translate(externalFrame.getInsets().left, externalFrame.getInsets().top);
            ((Graphics2D)g).setTransform(((Graphics2D)originalGraphics).getTransform());
           
            g.setColor(originalGraphics.getColor());                       
           
            if (isFlashing()) {
View Full Code Here

                    doDrawText(g, drawRect, selectionVisible, selStart, selEnd, hiliteColor);
                }
                else {
                    Image offscreenBuffer = fBufferCache.getBuffer(drawRect.width, drawRect.height);
                    Graphics offscreenGraphics = offscreenBuffer.getGraphics();
                    offscreenGraphics.translate(-drawRect.x, -drawRect.y);
   
                    doDrawText(offscreenGraphics, drawRect, selectionVisible, selStart, selEnd, hiliteColor);
   
                    g.drawImage(offscreenBuffer, drawRect.x, drawRect.y, fHost.fHost);
                }
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.