public void fillPolygon ( float alpha , double [ ] ... coord ) { int [ ] [ ] c = new int [ coord . length ] [ 2 ] ; for ( int i = 0 ; i < coord . length ; i ++ ) { c [ i ] = projection . screenProjection ( coord [ i ] ) ; } int [ ] x = new int [ c . length ] ; for ( int i = 0 ; i < c . length ; i ++ ) { x [ i ] = c [ i ] [ 0 ] ; } int [ ] y = new int [ c . length ] ; for ( int i = 0 ; i < c . length ; i ++ ) { y [ i ] = c [ i ] [ 1 ] ; } Composite cs = g2d . getComposite ( ) ; g2d . setComposite ( AlphaComposite . getInstance ( AlphaComposite . SRC_OVER , alpha ) ) ; g2d . fillPolygon ( x , y , c . length ) ; g2d . setComposite ( cs ) ; }
Fill polygon . The coordinates are in logical coordinates . This also supports basic alpha compositing rules for combining source and destination colors to achieve blending and transparency effects with graphics and images .