Package java.awt

Examples of java.awt.Graphics2D.clipRect()


            g = g2;
        }

        Rectangle2D clip = this.getClippingRectangle();
       
        g.clipRect(
                (int) clip.upperLeftCorner().x,
                (int) clip.upperLeftCorner().y,
                (int) clip.lowerRightCorner().x,
                (int) clip.lowerRightCorner().y);
View Full Code Here


        scaleFactor / 100d);
    int w = (int)(pageFormat.getImageableWidth() *
        scaleFactor / 100d);
    int h = (int)(pageFormat.getImageableHeight() *
        scaleFactor / 100d);
    g2.clipRect(x, y, w, h);
    g2.scale(scaleFactor / 100, scaleFactor / 100);
    try {
      printable.print(g, pageFormat, displayPage);
    } catch (PrinterException pe) {};
    g2.setTransform(at);
View Full Code Here

                    decoratedGraphics = decorator.prepare(component, decoratedGraphics);
                }

                // Paint the component
                Graphics2D componentGraphics = (Graphics2D)decoratedGraphics.create();
                componentGraphics.clipRect(0, 0, componentBounds.width, componentBounds.height);
                component.paint(componentGraphics);
                componentGraphics.dispose();

                // Update the decorators
                for (int j = 0; j < n; j++) {
View Full Code Here

        dataRenderer.setSize(Math.max(contentBounds.width - (padding.left + padding.right + 2) + 1,
            0), Math.max(contentBounds.height - (padding.top + padding.bottom + 2) + 1, 0));

        Graphics2D contentGraphics = (Graphics2D)graphics.create();
        contentGraphics.translate(padding.left + 1, padding.top + 1);
        contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here

        dataRenderer.render(buttonData, radioButton, false);
        dataRenderer.setSize(Math.max(width - (BUTTON_DIAMETER + spacing * 2), 0), height);

        Graphics2D contentGraphics = (Graphics2D)graphics.create();
        contentGraphics.translate(BUTTON_DIAMETER + spacing, 0);
        contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        // Paint the focus state
        if (radioButton.isFocused()) {
View Full Code Here

        dataRenderer.setSize(Math.max(contentBounds.width - (padding.left + padding.right + 2) + 1, 0),
            Math.max(contentBounds.height - (padding.top + padding.bottom + 2) + 1, 0));

        Graphics2D contentGraphics = (Graphics2D)graphics.create();
        contentGraphics.translate(padding.left + 1, padding.top + 1);
        contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here

            Math.max(getHeight() - paddingHeight(), 0)
        );

        Graphics2D contentGraphics = (Graphics2D) graphics.create();
        contentGraphics.translate(padding.left + 1, padding.top + 1);
        contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here

            dataRenderer.setSize(Math.max(width - (buttonPadding.left + buttonPadding.right + 2), 0),
                Math.max(getHeight() - (buttonPadding.top + buttonPadding.bottom + 2), 0));

            Graphics2D contentGraphics = (Graphics2D)graphics.create();
            contentGraphics.translate(buttonPadding.left + 1, buttonPadding.top + 1);
            contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
            dataRenderer.paint(contentGraphics);
            contentGraphics.dispose();
        }

        @Override
View Full Code Here

            if (scale != 1) {
                graphics.scale(scale, scale);
            }

            graphics.translate(xLocal, yLocal);
            graphics.clipRect(0, 0, getWidth(), getHeight());
        }

        return graphics;
    }
View Full Code Here

            // If the display host has been made non-displayable (as will
            // happen when the native peer closes), graphics will be null
            if (graphics != null) {
                double scale = displayHost.getScale();
                if (scale == 1) {
                    graphics.clipRect(x, y, width, height);
                } else {
                    graphics.clipRect((int)Math.floor(x * scale), (int)Math.floor(y * scale),
                        (int)Math.ceil(width * scale) + 1, (int)Math.ceil(height * scale) + 1);
                }

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.