import java.awt.*;
import java.awt.geom.*;

public class MyTx {
	public static void main (String[] args) {
		
		//Fenster erzeugen
		MyFrame frame = new MyFrame( "'Eine gewisse AFFINITÄT ist unverkennbar...'", 500,600 ) {
			public void paint(Graphics g) {
				
				//Upcast --> mehr Funktionen in Graphics2D
				Graphics2D g2d=(Graphics2D)g;
				g2d.setRenderingHint(   RenderingHints.KEY_ANTIALIASING,
							RenderingHints.VALUE_ANTIALIAS_ON );
		
				//neue Transformation erstellen		
				AffineTransform tx = new AffineTransform();
				//ein Testrechteck:
				RoundRectangle2D r = new RoundRectangle2D.Float(50,50,200,200,10,10);

				//r vor Transformation:
				g2d.setColor( Color.red );
				g2d.fill( r );
				
				//Transformationen konkatenieren
				tx.shear( 0.5,0.5 );
				tx.rotate( Math.PI/8, 50,50 );
				tx.translate( 20, 30 );
				tx.scale( 1.2,1.5 );
				
				//Transformation anwenden
				g2d.setTransform( tx );
				
				//r nach Transformation:
				g2d.setColor( new Color(0,180,0,200) );
				g2d.fill( r );
			}
		};
		
	}
}
