Here you can find the source of rotate(Shape shape, float angle, float x, float y)
public static Shape rotate(Shape shape, float angle, float x, float y)
//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); } }