g.drawImage( imgChart, r.x, r.y );
if ( imgChart != null ) { g.drawImage( imgChart, r.x, r.y ); }
	public final void paintClientArea( Graphics g )	{		if ( bPainting ) // PREVENT RE-ENTRANCY		{			return;		}		final Rectangle r = getClientArea( ).getCopy( );		if ( r.width <= 0 || r.height <= 0 )		{			return;		}		bPainting = true;		if ( bDirty )		{			bDirty = false;			// GET THE MODEL WRAPPED INSIDE THE REPORT ITEM IMPL			final Chart cm = (Chart) crii.getProperty( "chart.instance" ); //$NON-NLS-1$			if ( cm == null )			{				bPainting = false;				logger.log( ILogger.ERROR,						Messages.getString( "DesignerRepresentation.log.UnableToFind" ) ); //$NON-NLS-1$				return;			}			final Display d = Display.getCurrent( );			Dimension dSize = r.getSize( );			// OFFSCREEN IMAGE CREATION STRATEGY			if ( imgChart == null					|| imgChart.getImageData( ).width != dSize.width					|| imgChart.getImageData( ).height != dSize.height )			{				if ( gc != null )				{					gc.dispose( );				}				if ( imgChart != null )				{					imgChart.dispose( );				}				bDirty = true;				// FILL IMAGE WITH TRANSPARENCY				final ImageData ida = new ImageData( dSize.width,						dSize.height,						32,						PALETTE_DATA );				ida.transparentPixel = TRANSPARENT_COLOR;				/*				 * for (int i = 0; i < ida.width; i++) { for (int j = 0; j <				 * ida.height; j++) { ida.setPixel(i, j, TRANSPARENT_COLOR); } }				 */				imgChart = new Image( d, ida );				gc = new GC( imgChart );			}			final Color clrBG = new Color( d, 0x12, 0x34, 0x56 ); // TRANSPARENT			// COLOR INDEX			// (REVISIT?)			final Color clrPreviousBG = gc.getBackground( );			gc.setBackground( clrBG );			gc.fillRectangle( 0,					0,					imgChart.getImageData( ).width,					imgChart.getImageData( ).height );			clrBG.dispose( ); // DISPOSE			gc.setBackground( clrPreviousBG ); // RESTORE			// SETUP THE RENDERING CONTEXT			Bounds bo = BoundsImpl.create( 0, 0, dSize.width, dSize.height );			bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );			idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, gc );			Generator gr = Generator.instance( );			cm.clearSections( IConstants.RUN_TIME ); // REMOVE OLD TRANSIENT			// RUNTIME SERIES			cm.createSampleRuntimeSeries( ); // USING SAMPLE DATA STORED IN			// MODEL			try			{				RunTimeContext rtc = new RunTimeContext( );				rtc.setScriptingEnabled( false );				rtc.setMessageLookup( new BIRTDesignerMessageLookup(crii.getHandle()));				gr.render( idr,						gr.build( idr.getDisplayServer( ),								cm,								bo,								null,								rtc,								new ChartReportStyleProcessor( crii.getHandle( ),										true ) ) );			}			catch ( ChartException gex )			{				showException( gc, gex );			}		}		g.drawImage( imgChart, r.x, r.y );		bPainting = false;	}