buf = g.createBuffer(
(int)b.getWidth()+blurRadius*2,
(int)b.getHeight()+blurRadius*2);
//draw shape with shadow color
GFX g2 = buf.getGFX();
//fill shape with black
g2.setPaint(FlatColor.BLACK);
g2.translate(blurRadius,blurRadius);
g2.translate(-b.getX(),-b.getY());
initPaint(g2);
fillShape(g2);
drawShape(g2);
g2.translate(b.getX(),b.getY());
//blur
buf.apply(new BlurEffect(blurRadius));
g2.translate(-blurRadius,-blurRadius);
//use blur as alpha mask to draw in the real color
buf.apply(new WipeColorEffect(shadow.getColor()));
oldShadow = shadow;
}