Package java.awt

Examples of java.awt.Graphics2D.clipRect()


            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);
                }

                displayHost.paint(graphics);
                graphics.dispose();
View Full Code Here


  }

  protected void paintComponent(final Graphics g)
  {
    final Graphics2D g2 = (Graphics2D) g.create();
    g2.clipRect(0, 0, getWidth(), getHeight());
    g2.setColor(getBackground());
    g2.fillRect(0, 0, getWidth(), getHeight());

    if (elementStyleSheet == null)
    {
View Full Code Here

    final ImageIcon leftBorder = CanvasImageLoader.getInstance().getLeftShadowImage();
    g2.drawImage(leftBorder.getImage(), padding-8, 0, leftBorder.getIconWidth(), getHeight(), null);

    g2.translate(padding, 0);
    final int effectiveWidth = Math.max(0, getWidth() - padding);
    g2.clipRect(0, 0, effectiveWidth + 1, getHeight());

    double start = 0;
    double end = 0;
    if (pageDefinition != null)
    {
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

                    break;
                }
            }

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

            contentGraphics.dispose();

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

        dataRenderer.render(menuButton.getButtonData(), menuButton, highlighted);
        dataRenderer.setSize(contentBounds.width, contentBounds.height);

        Graphics2D contentGraphics = (Graphics2D)graphics.create();
        contentGraphics.translate(contentBounds.x, contentBounds.y);
        contentGraphics.clipRect(0, 0, contentBounds.width, contentBounds.height);
        dataRenderer.paint(contentGraphics);
        contentGraphics.dispose();

        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
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(x, y);
            graphics.clipRect(0, 0, getWidth(), getHeight());
        }

        return graphics;
    }
View Full Code Here

            // Paint the image
            Graphics2D imageGraphics = (Graphics2D)graphics.create();
            int buttonImageX = (width - buttonImageWidth) / 2;
            int buttonImageY = (height - buttonImageHeight) / 2;
            imageGraphics.translate(buttonImageX, buttonImageY);
            imageGraphics.clipRect(0, 0, buttonImageWidth, buttonImageHeight);
            buttonImage.paint(imageGraphics);
            imageGraphics.dispose();
        }

        @Override
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.