Package java.awt

Examples of java.awt.Graphics.translate()


                        int sw = s.width - ( insets == null ? 0 : ( ( insets.left + insets.right ) / 2 ) ) - ( borderWidth * 2 );
                        separator.setBounds(0, 0, sw, h);
                        int sx = (s.width - sw ) / 2;
                        g.translate(sx, py);
                        separator.paint(g);
                        g.translate(-sx, -py);
                        py += h;
                    }
                    else {
                      String n = (String) m.getValue(Action.SHORT_DESCRIPTION);
                      n = n == null ? m.getName() : n;
View Full Code Here


        g.setColor(Color.WHITE);
        g.fillRect(0, 0, getWidth(), getHeight());

        Graphics translated = g.create();
        translated.translate(MARGIN, MARGIN);

        count = 0;

        if (root != null) {
            paintRecursively(root, root.getDistance(), translated);
View Full Code Here

    offscreenG.setColor(context.getPaintBackground());
    offscreenG.fillRect(0, 0, width, height + 1);

    // Reset for text rendering
    offscreenG.setColor(g.getColor());
    offscreenG.translate(-x, -y);

    // Render the wrapped painter into the offscreen buffer.  We offset
    // the y coordinate by one so that no content will be rendered into
    // the top pixel.
    super.paint(context, offscreenG, x, y + 1, width, height);
View Full Code Here

        final int y = peerComponent.getY();
        final int width = peerComponent.getWidth();
        final int height = peerComponent.getHeight();
        Graphics g = SystemProperties.getProperty("gnu.javax.swing.noGraphics2D") == null ?
            new JNodeGraphics2D(this) : GraphicsFactory.getInstance().createGraphics(this);
        g.translate(x, y);
        g.clipRect(0, 0, width, height);

        /*
        Throwable t = new Throwable();
        StackTraceElement[] st = t.getStackTrace();
View Full Code Here

        if (job != null) {
            final Graphics pg = job.getGraphics();
            final Dimension pageSize = job.getPageDimension();

            if (pg != null) {
                pg.translate(LEFT, HEIGHT);
                pg.drawRect(0, 0, pageSize.width - LEFT - 1, pageSize.height - HEIGHT - 1);
                view.print(new PrintCanvas(pg, view));
                pg.dispose();
            }
View Full Code Here

        if (job != null) {
            final Graphics graphic = job.getGraphics();
            // Dimension pageSize = job.getPageDimension();

            if (graphic != null) {
                graphic.translate(10, 10);
                final int x = 50;
                int y = 50;

                graphic.setFont(TITLE_FONT);
View Full Code Here

    @Override
    public Canvas createSubcanvas(final int x, final int y, final int width, final int height) {
        final Graphics g = graphics.create();
        // this form of clipping must go here!
        g.translate(x, y);
        return new AwtCanvas(g, renderingArea, 0, 0, width, height);
    }

    @Override
    public void draw3DRectangle(final int x, final int y, final int width, final int height, final Color color, final boolean raised) {
View Full Code Here

                });
            } catch (Exception e) {
            }
        }

        tableScreenshotGraphics.translate(0, tableHeaderSize.height);

        final Component printSrc = source;

        // Component.printAll has to run in AWT Thread to print component contents correctly
        if (SwingUtilities.isEventDispatchThread()) {
View Full Code Here

        Image image = RepaintManager.currentManager(this).getVolatileOffscreenBuffer(this, 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));
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

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.