Package java.awt

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


    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

    }

    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

    graphics.translate(rectangle.getX(), rectangle.getY());
    graphics.setColor(FILL);
   
    if (clip != null)
    {
      graphics.clip(clip);
    }
   
    int width = (int) rectangle.getWidth();
    int limit = width + (int) rectangle.getHeight();
    int increment = lineGap + lineWidth;
View Full Code Here

          int xoffset = (int) (xalignFactor * (availableImageWidth - normalWidth));
          int yoffset = (int) (yalignFactor * (availableImageHeight - normalHeight));

          Shape oldClipShape = grx.getClip();

          grx.clip(
            new Rectangle(
              0,
              0,
              availableImageWidth,
              availableImageHeight
View Full Code Here

            int xoffset = (int) (xalignFactor * (availableImageWidth - normalWidth));
            int yoffset = (int) (yalignFactor * (availableImageHeight - normalHeight));

            Shape oldClipShape = grx.getClip();

            grx.clip(
              new Rectangle(
                0,
                0,
                availableImageWidth,
                availableImageHeight
View Full Code Here

        rowIndex = pageIndex / pagesPerRow;
        columnIndex = pageIndex - rowIndex * pagesPerRow;
      }
         
      Graphics2D g2D = (Graphics2D)g.create();
      g2D.clip(new Rectangle2D.Double(imageableX, imageableY, imageableWidth, imageableHeight));
      // Change coordinates system to paper imageable origin
      g2D.translate(imageableX - columnIndex * imageableWidth, imageableY - rowIndex * imageableHeight);
      g2D.scale(printScale, printScale);
      float extraMargin = getStrokeWidthExtraMargin(printedItems);
      g2D.translate(-printedItemBounds.getMinX() + extraMargin,
View Full Code Here

        Graphics2D g2d = bi.createGraphics();
        if (hints != null)
            g2d.addRenderingHints(hints);
        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
                             new WeakReference(bi));
        g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
        return g2d;
    }


    public static Graphics2D createGraphics(BufferedImage bi) {
View Full Code Here

    public static Graphics2D createGraphics(BufferedImage bi) {
        Graphics2D g2d = bi.createGraphics();
        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE,
                             new WeakReference(bi));
        g2d.clip(new Rectangle(0, 0, bi.getWidth(), bi.getHeight()));
        return g2d;
    }


    public final static boolean WARN_DESTINATION = true;
View Full Code Here

        //
        // Append transform to selected area
        //
        g.transform(curTxf);

        g.clip(curAOI);

        //
        // Delegate rendering to painter
        //
        try{
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.