private static void paintRegion ( SynthContext state , Graphics g , Rectangle bounds ) { JComponent c = state . getComponent ( ) ; SynthStyle style = state . getStyle ( ) ; int x ; int y ; int width ; int height ; if ( bounds == null ) { x = 0 ; y = 0 ; width = c . getWidth ( ) ; height = c . getHeight ( ) ; } else { x = bounds . x ; y = bounds . y ; width = bounds . width ; height = bounds . height ; } // Fill in the background, if necessary. boolean subregion = state . getRegion ( ) . isSubregion ( ) ; if ( ( subregion && style . isOpaque ( state ) ) || ( ! subregion && c . isOpaque ( ) ) ) { g . setColor ( style . getColor ( state , ColorType . BACKGROUND ) ) ; g . fillRect ( x , y , width , height ) ; } }
Paint a region .