rotate Awt Shape - Java java.lang

Java examples for java.lang:Math Geometry Shape

Description

rotate Awt Shape

Demo Code


//package com.java2s;

import java.awt.geom.*;

public class Main {
    public static java.awt.Shape rotateAwtShape(java.awt.Shape shape,
            double degrees) {
        AffineTransform transform = new AffineTransform();
        transform.rotate(Math.toRadians(degrees));
        return transform.createTransformedShape(shape);
    }/*from w  w w. j av a 2  s  .c o m*/
}

Related Tutorials