Java Graphics Rotate rotateArea(Area a, double rotation, Point2D rotateAround)

Here you can find the source of rotateArea(Area a, double rotation, Point2D rotateAround)

Description

rotate Area

License

Open Source License

Declaration

synchronized public static void rotateArea(Area a, double rotation, Point2D rotateAround) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.geom.*;

public class Main {
    synchronized public static void rotateArea(Area a, double rotation, Point2D rotateAround) {
        AffineTransform at1 = AffineTransform.getTranslateInstance(rotateAround.getX(), rotateAround.getY());
        at1.rotate(rotation);/*from  w  w w .  j av a2s  .  c o  m*/
        at1.translate(-rotateAround.getX(), -rotateAround.getY());
        a.transform(at1);
    }

    synchronized public static void rotateArea(Area a, double rotation) {
        Rectangle2D bounds = a.getBounds2D();
        rotateArea(a, rotation,
                new Point2D.Double(bounds.getX() + bounds.getWidth() / 2, bounds.getY() + bounds.getHeight() / 2));
    }
}

Related

  1. rotate(Point p, double angle)
  2. rotate(Point toRotate, float tetta)
  3. rotate(Point2D.Double point, double dAngle)
  4. rotate(Shape shape, float angle, float x, float y)
  5. rotate_point(double rx, double ry, double angle, double cx, double cy)
  6. rotateBy(Vector points, double theta, Vector newPoints)
  7. rotateByAngle(final Point2D pos, final Point2D center, final double angle)
  8. rotateClockwise(Path source, Path target)
  9. rotateCoor(float x, float y, float theta)