public static float[][] toMatrix(AffineTransform xform){
  return new float[][]{{(float)xform.getScaleX(),(float)xform.getShearX(),0},{(float)xform.getShearY(),(float)xform.getScaleY(),0},{(float)xform.getTranslateX(),(float)xform.getTranslateY(),1}};
}

public static float [ ] [ ] toMatrix ( AffineTransform xform ) { return new float [ ] [ ] { { ( float ) xform . getScaleX ( ) , ( float ) xform . getShearX ( ) , 0 } , { ( float ) xform . getShearY ( ) , ( float ) xform . getScaleY ( ) , 0 } , { ( float ) xform . getTranslateX ( ) , ( float ) xform . getTranslateY ( ) , 1 } } ; }
please call this function only on device bound transformation not good for general use cases ;
