public Paint getTopShadowGradient ( Shape s ) { Rectangle2D bounds = s . getBounds2D ( ) ; float minY = ( float ) bounds . getMinY ( ) ; float maxY = ( float ) bounds . getMaxY ( ) ; float midX = ( float ) bounds . getCenterX ( ) ; return new LinearGradientPaint ( midX , minY , midX , maxY , ( new float [ ] { 0f , 1f } ) , new Color [ ] { innerShadow . top , transparentColor } ) ; }
Create the gradient for the top of a rectangular shadow .