Example usage for java.awt.geom AffineTransform rotate

List of usage examples for java.awt.geom AffineTransform rotate

Introduction

In this page you can find the example usage for java.awt.geom AffineTransform rotate.

Prototype

public void rotate(double vecx, double vecy, double anchorx, double anchory) 

Source Link

Document

Concatenates this transform with a transform that rotates coordinates around an anchor point according to a rotation vector.

Usage

From source file:Main.java

public void paint(Graphics g) {
    Shape shape = new Rectangle2D.Float(100, 50, 80, 80);

    Graphics2D g2 = (Graphics2D) g;

    AffineTransform at = new AffineTransform();
    at.rotate(0.3, 0.2, 0.5, 0.3);

    g2.setTransform(at);/*from   www . j a  v a 2s.c o  m*/
    g2.draw(shape);

}