Package java.awt

Examples of java.awt.Graphics2D.clipRect()


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

            graphics.translate(x, y);
            graphics.clipRect(0, 0, getWidth(), getHeight());
        }

        return graphics;
    }
View Full Code Here


              imageableHeight, paper.getImageableHeight());
          break;
      }
      pageFormat.setPaper(paper);
      if (clipBounds == null) {
        g2D.clipRect((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY(),
            (int)pageFormat.getImageableWidth(), (int)pageFormat.getImageableHeight());
      } else
        g2D.clipRect(clipBounds.x, (int)pageFormat.getImageableY(),
            clipBounds.width, (int)pageFormat.getImageableHeight());
      }
View Full Code Here

      pageFormat.setPaper(paper);
      if (clipBounds == null) {
        g2D.clipRect((int)pageFormat.getImageableX(), (int)pageFormat.getImageableY(),
            (int)pageFormat.getImageableWidth(), (int)pageFormat.getImageableHeight());
      } else
        g2D.clipRect(clipBounds.x, (int)pageFormat.getImageableY(),
            clipBounds.width, (int)pageFormat.getImageableHeight());
      }
    }
   
    if (page == 0) {
View Full Code Here

    if (this.backgroundPainted) {
      paintBackground(g2D, backgroundColor);
    }
    Insets insets = getInsets();
    // Clip component to avoid drawing in empty borders
    g2D.clipRect(insets.left, insets.top,
        getWidth() - insets.left - insets.right,
        getHeight() - insets.top - insets.bottom);
    // Change component coordinates system to plan system
    Rectangle2D planBounds = getPlanBounds();   
    float paintScale = getScale();
View Full Code Here

    protected void paintComponent(Graphics g) {
      Graphics2D g2D = (Graphics2D)g.create();
      paintBackground(g2D);
      Insets insets = getInsets();
      // Clip component to avoid drawing in empty borders
      g2D.clipRect(insets.left, insets.top,
          getWidth() - insets.left - insets.right,
          getHeight() - insets.top - insets.bottom);
      // Change component coordinates system to plan system
      Rectangle2D planBounds = getPlanBounds();   
      float paintScale = getScale();
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

  }

  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

                default: {
                    break;
                }
            }

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

            contentGraphics.dispose();

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

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

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

        return graphics;
    }
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.