Examples of createTransformedShape()


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

            }
        }

        if (dx != 0 || dy != 0) {
            AffineTransform tx = AffineTransform.getTranslateInstance(dx, dy);
            result = (GeneralPath)tx.createTransformedShape(result);
        }
        LayoutPathImpl lp = textLine.getLayoutPath();
        if (lp != null) {
            result = (GeneralPath)lp.mapShape(result);
        }
View Full Code Here

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

                AffineTransform at = tlc.getBaselineTransform();
                if (at != null) {
                    AffineTransform tx = AffineTransform.getTranslateInstance
                        (pt.x - at.getTranslateX(), pt.y - at.getTranslateY());
                    tx.concatenate(at);
                    r = tx.createTransformedShape(r).getBounds2D();
                } else {
                    r.setRect(r.getMinX() + pt.x, r.getMinY() + pt.y,
                              r.getWidth(), r.getHeight());
                }
            }
View Full Code Here

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

                    AffineTransform transform = decorator.getTransform(this);

                    if (!transform.isIdentity()) {
                        // Apply the decorator's transform to the repaint area
                        Rectangle area = new Rectangle(x, y, width, height);
                        Shape transformedShape = transform.createTransformedShape(area);
                        Bounds tranformedBounds = new Bounds(transformedShape.getBounds());

                        // Limit the transformed area to the decorator's bounds
                        tranformedBounds = tranformedBounds.intersect(decorator.getBounds(this));
View Full Code Here

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

            }
            Rectangle2D translatedRect = rect;
            if (!combined.isIdentity()) {
                try {
                    AffineTransform inverse = combined.createInverse();
                    translatedRect = inverse.createTransformedShape(rect).getBounds2D();
                } catch (NoninvertibleTransformException e) {
                    e.printStackTrace();
                }
            }
View Full Code Here

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

            transform.preConcatenate(AffineTransform.getScaleInstance(scaleX, scaleY));
        }

        // Rotate
        if (cropBounds.getAngle() != 0) {
            Rectangle2D bounds = transform.createTransformedShape(sourceBounds).getBounds2D();

            Point2D center = new Point2D.Double(bounds.getCenterX(), bounds.getCenterY());

            transform.preConcatenate(AffineTransform.getRotateInstance(-cropBounds.getAngle(),
                                                                       center.getX(),
View Full Code Here

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

            transform.preConcatenate(AffineTransform.getRotateInstance(-cropBounds.getAngle(),
                                                                       center.getX(),
                                                                       center.getY()));

            bounds = transform.createTransformedShape(sourceBounds).getBounds2D();
            transform.preConcatenate(AffineTransform.getTranslateInstance(-bounds.getMinX(), -bounds.getMinY()));
        }

        // Crop
        if (!cropBounds.isAngleOnly()) {
View Full Code Here

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

        repaint();
        try {
            AffineTransform xform = getTransform();
            xform = xform.createInverse();
            Rectangle2D viewportRect =
                xform.createTransformedShape(pannerRect).getBounds2D();
            Rectangle intRect = new Rectangle(
                (int) Math.round(viewportRect.getX()),
                (int) Math.round(viewportRect.getY()),
                (int) Math.round(viewportRect.getWidth()),
                (int) Math.round(viewportRect.getHeight())
View Full Code Here

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

        repaint();
        try {
            AffineTransform xform = getTransform();
            xform = xform.createInverse();
            Rectangle2D viewportRect =
                xform.createTransformedShape(pannerRect).getBounds2D();
            Rectangle intRect = new Rectangle(
                (int) Math.round(viewportRect.getX()),
                (int) Math.round(viewportRect.getY()),
                (int) Math.round(viewportRect.getWidth()),
                (int) Math.round(viewportRect.getHeight())
View Full Code Here

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

    // Get the view bounds in panner coordinates
    private Rectangle2D getViewBounds() {
        Dimension viewSize = scroll.getViewport().getView().getSize();
        Rectangle viewRect = new Rectangle(0, 0, viewSize.width, viewSize.height);
        AffineTransform xform = getTransform();
        Shape pannerRect = xform.createTransformedShape(viewRect);
        return pannerRect.getBounds2D();
    }

    // Get the viewport bounds in panner coordinates
    private Rectangle2D getViewportBounds() {
View Full Code Here

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

    // Get the viewport bounds in panner coordinates
    private Rectangle2D getViewportBounds() {
        JViewport viewport = scroll.getViewport();
        Rectangle viewportRect = viewport.getViewRect();
        AffineTransform xform = getTransform();
        Shape pannerRect = xform.createTransformedShape(viewportRect);
        return pannerRect.getBounds2D();
    }

    // Get the transform that maps view coordinates into panner coordinates
    private AffineTransform getTransform() {
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.