Examples of createTransformedShape()


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

    private static Shape justify(Shape shape) {
        Rectangle2D bounds = shape.getBounds();
        AffineTransform xform = AffineTransform.getTranslateInstance(
            - bounds.getX(), - bounds.getY()
        );
        return xform.createTransformedShape(shape);
    }

    private static Shape stringToShape(Graphics2D g, String s, float size) {
        FontRenderContext context = g.getFontRenderContext();
        Font font = g.getFont();
View Full Code Here

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

            // Distribute vertically:
            double h = inset + n * maxHeight;
            // Center horizontally:
            double w = (size.width - widths[n]) / 2.;
            AffineTransform xform = AffineTransform.getTranslateInstance(w, h);
            shapes[n] = xform.createTransformedShape(shapes[n]);
            area.add(new Area(shapes[n]));
        }
        ShapeRegion region = new ShapeRegion(area);
        return region;
    }
View Full Code Here

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

        if(aoi == null) {
            aoi = dimensions.getBounds();
        }

        // Transform the area of interest.
        Shape transformedAOI = usr2dev.createTransformedShape(aoi);

        // Create a TiledImage to be used as the canvas.
        TiledImage ti = createTiledImage(hints, transformedAOI.getBounds());

        // Create the associated Graphics2D object and translate it to
View Full Code Here

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

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

      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

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

      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

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

      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

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

      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

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

        }
        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

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

        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
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.