*/
private static Shape performDefaultTransformation(final Shape shape,
final double scaleX,
final double scaleY)
{
/**
* Apply the normalisation shape transform ... bring the shape to pos (0,0)
*/
final Rectangle2D bounds = shape.getBounds2D();
final AffineTransform translateTransform
= AffineTransform.getTranslateInstance(0 - bounds.getX(), 0 - bounds.getY());
// apply normalisation translation ...
final Shape translatedShape = translateTransform.createTransformedShape(shape);
final AffineTransform scaleTransform = AffineTransform.getScaleInstance(scaleX, scaleY);
// apply scaling ...
final Shape scaledShape = scaleTransform.createTransformedShape(translatedShape);
// now retranslate the shape to its original position ...
final AffineTransform translateBackTransform =
AffineTransform.getTranslateInstance(bounds.getX(), bounds.getY());
return translateBackTransform.createTransformedShape(scaledShape);
}