Examples of clip()


Examples of java.awt.Graphics2D.clip()

  public void draw(final Graphics2D g2, final Rectangle2D bounds)
  {
    final Graphics2D gr2 = (Graphics2D) g2.create();
    try
    {
      gr2.clip(bounds);
      if (scale)
      {
        final Dimension size = barcode.getPreferredSize();
        final double horzScale = bounds.getWidth() / size.getWidth();
        final double vertScale = bounds.getHeight() / size.getHeight();
View Full Code Here

Examples of java.awt.Graphics2D.clip()

          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
View Full Code Here

Examples of java.awt.Graphics2D.clip()

      scaleTransform = null;
    }
    else
    {
      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.clip(new Rectangle2D.Float(0, 0, width, height));

      final double scaleX;
      final double scaleY;
View Full Code Here

Examples of java.awt.Graphics2D.clip()

    else
    {
      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.clip(new Rectangle2D.Float(0, 0, width, height));

      final double scaleX;
      final double scaleY;

      final boolean keepAspectRatio = layoutContext.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

      }

      final Rectangle2D.Double clipBounds = new Rectangle2D.Double
          (x - extraPadding, y - extraPadding, width + 2 * extraPadding, height + 2 * extraPadding);

      clone.clip(clipBounds);
      clone.translate(x, y);
    }
    else
    {
      final Rectangle2D.Double clipBounds = new Rectangle2D.Double(x, y, width + 1, height + 1);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

    }
    else
    {
      final Rectangle2D.Double clipBounds = new Rectangle2D.Double(x, y, width + 1, height + 1);

      clone.clip(clipBounds);
      clone.translate(x, y);
    }
    configureGraphics(styleSheet, clone);
    configureStroke(styleSheet, clone);
    final Rectangle2D.Double bounds = new Rectangle2D.Double(0, 0, width, height);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

          (ElementAlignment) layoutContext.getStyleProperty(ElementStyleKeys.VALIGNMENT);
      final int alignmentX = (int) RenderUtility.computeHorizontalAlignment(horizontalAlignment, width, clipWidth);
      final int alignmentY = (int) RenderUtility.computeVerticalAlignment(verticalAlignment, height, clipHeight);

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

    }

    final Rectangle2D.Double drawAreaBounds = new Rectangle2D.Double
        (x - extraPadding, y - extraPadding, width + 2 * extraPadding, height + 2 * extraPadding);

    clone.clip(drawAreaBounds);
    clone.translate(x, y);
    if (shouldFill)
    {
      configureFillColor(layoutContext, clone);
      clone.fill(scaledShape);
View Full Code Here

Examples of java.awt.Graphics2D.clip()

      g2 = (Graphics2D) getGraphics().create();
      g2.clip(drawAreaBounds);
      g2.translate(x, y);
      g2.translate(alignmentX, alignmentY);
      g2.clip(new Rectangle2D.Float(0, 0, clipWidth, clipHeight));
      g2.scale(deviceScaleFactor, deviceScaleFactor);

      scaleTransform = null;
    }
    else
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.