public Paint getRoundedShadowGradient ( Shape s ) { Rectangle r = s . getBounds ( ) ; int x = r . x + r . width / 2 ; int y1 = r . y ; float frac = 1.0f / r . height ; int y2 = r . y + r . height ; return new LinearGradientPaint ( x , y1 , x , y2 , ( new float [ ] { 0f , frac , 1f } ) , new Color [ ] { innerShadow . top , innerShadow . bottom , innerShadow . bottom } ) ; }
Create the gradient for a rounded shadow .