Package java.awt.geom

Examples of java.awt.geom.AffineTransform.createTransformedShape()


      final double rotX = Math.cos(Math.PI)*xRot - Math.sin(Math.PI)*yRot;
      final double rotY = Math.sin(Math.PI)*xRot + Math.cos(Math.PI)*yRot;

      final AffineTransform at = AffineTransform.getTranslateInstance(xRot-rotX, yRot-rotY);
      at.rotate(Math.PI);
      s = at.createTransformedShape(s);
    }

    path.append(s, false);
  }

View Full Code Here


      final double cy      = (tlPoint.getY()+brPoint.getY())/2.;
      final double c2x      = Math.cos(angle)*cx - Math.sin(angle)*cy;
      final double c2y      = Math.sin(angle)*cx + Math.cos(angle)*cy;
      final AffineTransform at = AffineTransform.getTranslateInstance(cx - c2x, cy - c2y);
      at.rotate(angle);
      sh              = at.createTransformedShape(shape);
    }

    return sh;
  }

View Full Code Here

      final double c2x   = cos(rotationAngle)*cx - sin(rotationAngle)*cy;
      final double c2y   = sin(rotationAngle)*cx + cos(rotationAngle)*cy;
      final AffineTransform at = AffineTransform.getTranslateInstance(cx - c2x, cy - c2y);

      at.rotate(rotationAngle);
      intersects = at.createTransformedShape(path).intersects(r) || at.createTransformedShape(pathLabels).intersects(r);
    }

    return intersects;
  }

View Full Code Here

      final double c2x   = cos(rotationAngle)*cx - sin(rotationAngle)*cy;
      final double c2y   = sin(rotationAngle)*cx + cos(rotationAngle)*cy;
      final AffineTransform at = AffineTransform.getTranslateInstance(cx - c2x, cy - c2y);

      at.rotate(rotationAngle);
      intersects = at.createTransformedShape(path).intersects(r) || at.createTransformedShape(pathLabels).intersects(r);
    }

    return intersects;
  }

View Full Code Here

      final double c2x   = cos(rotationAngle)*cx - sin(rotationAngle)*cy;
      final double c2y   = sin(rotationAngle)*cx + cos(rotationAngle)*cy;
      final AffineTransform at = AffineTransform.getTranslateInstance(cx - c2x, cy - c2y);

      at.rotate(rotationAngle);
      intersects = at.createTransformedShape(pa).intersects(r);
    }

    return intersects;
  }

View Full Code Here

        }
        final FontMetrics fm = g2.getFontMetrics();
        final Rectangle2D bounds = TextUtilities.getTextBounds(text, g2, fm);
        final AffineTransform translate = AffineTransform.getTranslateInstance(
                textX, textY);
        final Shape translatedBounds = translate.createTransformedShape(bounds);
        final AffineTransform rotate = AffineTransform.getRotateInstance(
                angle, rotateX, rotateY);
        final Shape result = rotate.createTransformedShape(translatedBounds);
        return result;
View Full Code Here

        final AffineTransform translate = AffineTransform.getTranslateInstance(
                textX, textY);
        final Shape translatedBounds = translate.createTransformedShape(bounds);
        final AffineTransform rotate = AffineTransform.getRotateInstance(
                angle, rotateX, rotateY);
        final Shape result = rotate.createTransformedShape(translatedBounds);
        return result;

    }

    /**
 
View Full Code Here

        // Map the destination bounds to rendered coordinates. This method
        // will cause extra data to be present if there is any rotation or
        // shear.
        AffineTransform tf = renderContext.getTransform();
        Rectangle2D rect = tf.createTransformedShape(dstRect2D).getBounds2D();

        // Make sure that the rendered rectangle is non-empty.
        if(rect.getWidth() < 1.0 || rect.getHeight() < 1.0) {
            double w = Math.max(rect.getWidth(), 1.0);
            double h = Math.max(rect.getHeight(), 1.0);
View Full Code Here

            rgn = new Rectangle2D.Float(0.0F, 0.0F, aspectRatio, 1.0F);
        }

        // Apply the renderable-to-rendered mapping to the renderable
        // destination region of interest.
        Rectangle dstROI = at.createTransformedShape(rgn).getBounds();

        // Calculate the pure scale portion of the
        // renderable-to-rendered mapping.
        AffineTransform scale =
            AffineTransform.getScaleInstance(dstROI.getWidth()/
View Full Code Here

        int height;
        if(at.isIdentity()) { // Default rendering.
            AffineTransform afn =
                (AffineTransform)paramBlock.getObjectParameter(6);
            Rectangle2D bounds =
                afn.createTransformedShape(bounds2D).getBounds2D();
            double H = maxHeight*bounds.getHeight();
            double W = maxHeight*bounds.getWidth();
            double m = Math.max(H, W/aspectRatioSource);
            height = (int)(m + 0.5);
            width = (int)(aspectRatioSource*m + 0.5);
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.