Java Graphics Rotate rotate(Shape shape, float angle, float x, float y)

Here you can find the source of rotate(Shape shape, float angle, float x, float y)

Description

rotate

License

Open Source License

Declaration

public static Shape rotate(Shape shape, float angle, float x, float y) 

Method Source Code


//package com.java2s;
import java.awt.Shape;
import java.awt.geom.AffineTransform;

public class Main {
    public static Shape rotate(Shape shape, float angle, float x, float y) {
        if (angle == 0) {
            return shape;
        }/*from w ww.  jav a  2  s.  com*/
        return AffineTransform.getRotateInstance(Math.toRadians(360 - angle), x, y).createTransformedShape(shape);
    }
}

Related

  1. rotate(final Point2D pos, final Point2D center, final double dist)
  2. rotate(final Point2D vec, final double theta)
  3. rotate(Point p, double angle)
  4. rotate(Point toRotate, float tetta)
  5. rotate(Point2D.Double point, double dAngle)
  6. rotate_point(double rx, double ry, double angle, double cx, double cy)
  7. rotateArea(Area a, double rotation, Point2D rotateAround)
  8. rotateBy(Vector points, double theta, Vector newPoints)
  9. rotateByAngle(final Point2D pos, final Point2D center, final double angle)