Example usage for java.awt.geom AffineTransform setToShear

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

Introduction

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

Prototype

public void setToShear(double shx, double shy) 

Source Link

Document

Sets this transform to a shearing transformation.

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.setToShear(Math.PI / 6, Math.PI / 6);

    g2.setTransform(at);//from w w w.  ja  v  a2s  .  c  o  m
    g2.draw(shape);

}