gcs.getRunTimeContext( ).clearState( );
	public final void render( IDeviceRenderer idr, GeneratedChartState gcs )			throws ChartException	{		final Chart cm = gcs.getChartModel( );		ScriptHandler.callFunction( gcs.getRunTimeContext( ).getScriptHandler( ),				ScriptHandler.START_RENDERING,				gcs );		Legend lg = cm.getLegend( );		lg.updateLayout( cm ); // RE-ORGANIZE BLOCKS IF REQUIRED		if ( lg.getPosition( ) == Position.INSIDE_LITERAL )		{			int iType = gcs.getType( );			if ( iType == WITH_AXES )			{				Bounds bo = ( (PlotWith2DAxes) gcs.getComputations( ) ).getPlotBounds( );				try				{					updateLegendInside( bo,							lg,							idr.getDisplayServer( ),							cm,							gcs.getRunTimeContext( ) );				}				catch ( ChartException gex )				{					throw new ChartException( ChartEnginePlugin.ID,							ChartException.RENDERING,							gex );				}			}		}		final LinkedHashMap lhm = (LinkedHashMap) gcs.getRenderers( );		final int iSize = lhm.size( );		BaseRenderer br;		final Collection co = lhm.values( );		final LegendItemRenderingHints[] lirha = (LegendItemRenderingHints[]) co.toArray( EMPTY_LIRHA );		final DeferredCache dc = new DeferredCache( idr, cm ); // USED IN		// RENDERING		// ELEMENTS WITH		// THE CORRECT		// Z-ORDER		// USE SAME BOUNDS FOR RENDERING AS THOSE USED TO PREVIOUSLY COMPUTE THE		// CHART OFFSCREEN		final Bounds bo = gcs.getChartModel( ).getBlock( ).getBounds( );		idr.setProperty( IDeviceRenderer.EXPECTED_BOUNDS,				bo.scaledInstance( idr.getDisplayServer( ).getDpiResolution( ) / 72d ) );		// UPDATE THE STRUCTURE DEFINITION LISTENER MAINTAINED BY THE RUNTIME		// CONTEXT		gcs.getRunTimeContext( )				.setStructureDefinitionListener( idr.needsStructureDefinition( ) ? idr						: null );		idr.before( ); // INITIALIZATION BEFORE RENDERING BEGINS		for ( int i = 0; i < iSize; i++ )		{			br = lirha[i].getRenderer( );			br.set( dc );			br.set( idr );			br.set( gcs.getRunTimeContext( ) );			try			{				br.render( lhm, bo ); // 'bo' MUST BE CLIENT AREA WITHIN ANY				// 'shell' OR 'frame'			}			catch ( Exception ex )			{				ex.printStackTrace( );				throw new ChartException( ChartEnginePlugin.ID,						ChartException.RENDERING,						ex );			}		}		idr.after( ); // ANY CLEANUP AFTER THE CHART HAS BEEN RENDERED		ScriptHandler.callFunction( gcs.getRunTimeContext( ).getScriptHandler( ),				ScriptHandler.FINISH_RENDERING,				gcs );	}