Package java.awt

Examples of java.awt.Graphics2D.clipRect()


        dataRenderer.setSize(Math.max(width - (padding.left + padding.right + 2), 0),
            Math.max(getHeight() - (padding.top + padding.bottom + 2), 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


            g2.setPaint( pntBackground );
//            g2.fillRect( li.r.x, li.r.y, li.r.width, li.r.height );
            g2.fillRect( r.x, r.y, r.width, r.height );
          }
//          g2.clipRect( li.r.x, li.r.y, li.r.width, li.r.height );
          g2.clipRect( r.x, r.y, r.width, r.height );
//          g2.translate( li.r.x, li.r.y );
          g2.translate( r.x, r.y );
//          li.c.paint( this, g2 );
          c.paint( g2 );
          g2.setClip( clipOrig );
View Full Code Here

        dataRenderer.setSize(Math.max(width - (padding.left + padding.right + 2), 0),
            Math.max(getHeight() - (padding.top + padding.bottom + 2), 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

        double sinTheta = Math.sin(theta);
        double cosTheta = Math.cos(theta);

        Graphics2D watermarkGraphics = (Graphics2D)graphics.create();
        watermarkGraphics.clipRect(0, 0, component.getWidth(), component.getHeight());
        watermarkGraphics.setComposite(AlphaComposite.getInstance
            (AlphaComposite.SRC_OVER, opacity));
        watermarkGraphics.rotate(theta);

        // Calculate the separation in between each repetition of the watermark
View Full Code Here

                    break;
                }
            }

            contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
            dataRenderer.paint(contentGraphics);

            contentGraphics.dispose();

            // Draw the close trigger
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

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

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

        return graphics;
    }
View Full Code Here

                        /* Setup a Graphics2D on to the BufferedImage so that
                         * the source image when copied, lands within the
                         * image buffer.
                         */
                        Graphics2D imageGraphics = deepImage.createGraphics();
                        imageGraphics.clipRect(0, 0,
                                               deepImage.getWidth(),
                                               deepImage.getHeight());

                        imageGraphics.translate(-rotBounds.getX(),
                                                -rotBounds.getY());
View Full Code Here

    int h = (int)(centreY * height);
    int d = (int)(gap * height);

    Graphics2D g = dst.createGraphics();
    clip = g.getClip();
    g.clipRect( 0, 0, width, h );
    g.drawRenderedImage( src, null );
    g.setClip( clip );
    g.clipRect( 0, h+d, width, height-h-d );
    g.translate( 0, 2*h+d );
    g.scale( 1, -1 );
View Full Code Here

    Graphics2D g = dst.createGraphics();
    clip = g.getClip();
    g.clipRect( 0, 0, width, h );
    g.drawRenderedImage( src, null );
    g.setClip( clip );
    g.clipRect( 0, h+d, width, height-h-d );
    g.translate( 0, 2*h+d );
    g.scale( 1, -1 );
    g.drawRenderedImage( src, null );
    g.setPaint( new GradientPaint( 0, 0, new Color( 1.0f, 0.0f, 0.0f, 0.0f ), 0, h, new Color( 0.0f, 1.0f, 0.0f, opacity ) ) );
    g.setComposite( AlphaComposite.getInstance( AlphaComposite.DST_IN ) );
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.