bNeedsGeneration = false; try { gcs = gr.build( idr.getDisplayServer( ), cm, bo, null, null, null ); } catch ( ChartException ex ) { showException( g2d, ex ); }
updateBuffer( );
	public void paint( Graphics g )	{		super.paint( g );		Graphics2D g2d = (Graphics2D) g;		idr.setProperty( IDeviceRenderer.GRAPHICS_CONTEXT, g2d );		idr.setProperty( IDeviceRenderer.UPDATE_NOTIFIER, this );		Dimension d = getSize( );		Bounds bo = BoundsImpl.create( 0, 0, d.width, d.height );		bo.scale( 72d / idr.getDisplayServer( ).getDpiResolution( ) );		Generator gr = Generator.instance( );		// When the update button has been pushed, build a chart offscreen.		if ( bNeedsGeneration )		{			bNeedsGeneration = false;			try			{				gcs = gr.build( idr.getDisplayServer( ),						cm,						bo,						null,						null,						null );			}			catch ( ChartException ex )			{				showException( g2d, ex );			}		}		// Draw the previous built chart on screen.		try		{			gr.render( idr, gcs );		}		catch ( ChartException ex )		{			showException( g2d, ex );		}	}