Example usage for java.awt.geom AffineTransform setToQuadrantRotation

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

Introduction

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

Prototype

public void setToQuadrantRotation(int numquadrants) 

Source Link

Document

Sets this transform to a rotation transformation that rotates coordinates by the specified number of quadrants.

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.setToQuadrantRotation(2);

    g2.setTransform(at);//from   ww w  .  jav a  2s . co m
    g2.draw(shape);

}