question: public static void drawShadow ( final Rectangle2D rect , final Graphics2D g2 ) { Graphics2D g2S = ( Graphics2D ) g2 . create ( ) ; Rectangle2D shadow = new Rectangle2D . Double ( rect . getX ( ) + 5 , rect . getY ( ) + ProcessDrawer . HEADER_HEIGHT + 5 , rect . getWidth ( ) , rect . getHeight ( ) - ProcessDrawer . HEADER_HEIGHT ) ; GeneralPath bottom = new GeneralPath ( ) ; bottom . moveTo ( shadow . getX ( ) , rect . getMaxY ( ) ) ; bottom . lineTo ( rect . getMaxX ( ) , rect . getMaxY ( ) ) ; bottom . lineTo ( shadow . getMaxX ( ) , shadow . getMaxY ( ) ) ; bottom . lineTo ( shadow . getMinX ( ) , shadow . getMaxY ( ) ) ; bottom . closePath ( ) ; g2S . setPaint ( new GradientPaint ( ( float ) rect . getX ( ) , ( float ) rect . getMaxY ( ) , Color . gray , ( float ) rect . getX ( ) , ( float ) shadow . getMaxY ( ) , TRANSPARENT_GRAY ) ) ; g2S . fill ( bottom ) ; GeneralPath right = new GeneralPath ( ) ; right . moveTo ( rect . getMaxX ( ) , shadow . getMinY ( ) ) ; right . lineTo ( shadow . getMaxX ( ) , shadow . getMinY ( ) ) ; right . lineTo ( shadow . getMaxX ( ) , shadow . getMaxY ( ) ) ; right . lineTo ( rect . getMaxX ( ) , rect . getMaxY ( ) ) ; right . closePath ( ) ; g2S . setPaint ( new GradientPaint ( ( float ) rect . getMaxX ( ) , ( float ) shadow . getY ( ) , Color . gray , ( float ) shadow . getMaxX ( ) , ( float ) shadow . getY ( ) , TRANSPARENT_GRAY ) ) ; g2S . fill ( right ) ; g2S . dispose ( ) ; }
target:  Draws a shadow around the given rectangle.