public Rectangular transformRect ( Rectangular rect ) { if ( transform != null ) { Rectangle src = new Rectangle ( rect . getX1 ( ) , rect . getY1 ( ) , rect . getWidth ( ) , rect . getHeight ( ) ) ; Shape dest = transform . createTransformedShape ( src ) ; Rectangle destr ; if ( dest instanceof Rectangle ) destr = ( Rectangle ) dest ; else destr = dest . getBounds ( ) ; return new Rectangular ( destr ) ; } else return rect ; }
Transforms a rectangle to other rectangle using the given transformation .