tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) ); if ( tg.getCondition( ) == TriggerCondition.MOUSE_CLICK_LITERAL || tg.getCondition( ) == TriggerCondition.ONCLICK_LITERAL )
final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createSeries( se ), InteractionEvent.class ); for ( int t = 0; t < elTriggers.size( ); t++ )
	protected final void renderLegendItem( IPrimitiveRenderer ipr, Legend lg,			Label la, Label valueLa, double dX, double dY, double dW,			double dItemHeight, double dFullHeight, double dValueHeight,			double dValueWidth, double dLeftInset, double dHorizontalSpacing,			Series se, Fill fPaletteEntry, LegendItemRenderingHints lirh )			throws ChartException	{		ScriptHandler sh = getRunTimeContext( ).getScriptHandler( );		ScriptHandler.callFunction( sh,				ScriptHandler.BEFORE_DRAW_LEGEND_ENTRY,				la );		getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_LEGEND_ENTRY,				la );		final Bounds bo = lirh.getLegendGraphicBounds( );		bo.setLeft( dX + dLeftInset + 1 );		bo.setTop( dY + 1 );		bo.setWidth( 3 * dItemHeight / 2 );		bo.setHeight( dItemHeight - 2 );		final BaseRenderer br = lirh.getRenderer( );		br.renderLegendGraphic( ipr, lg, fPaletteEntry, bo );		final TextRenderEvent tre = (TextRenderEvent) ( (EventObjectCache) ir ).getEventObject( StructureSource.createLegend( lg ),				TextRenderEvent.class );		tre.setLocation( LocationImpl.create( dX				+ dLeftInset				+ ( 3 * dItemHeight / 2 )				+ dHorizontalSpacing, dY + dFullHeight / 2 - 1 ) );		tre.setTextPosition( TextRenderEvent.RIGHT );		tre.setLabel( la );		tre.setAction( TextRenderEvent.RENDER_TEXT_AT_LOCATION );		ipr.drawText( tre );		if ( valueLa != null )		{			Location[] loaBack = new Location[4];			final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ir ).getEventObject( StructureSource.createLegend( lg ),					PolygonRenderEvent.class );			pre.setBackground( valueLa.getBackground( ) );			pre.setOutline( valueLa.getOutline( ) );			pre.setPoints( loaBack );			loaBack[0] = LocationImpl.create( dX + dLeftInset + 1, dY					+ dFullHeight					+ 1 );			loaBack[1] = LocationImpl.create( dX + dLeftInset + 1, dY					+ dFullHeight					+ dValueHeight );			loaBack[2] = LocationImpl.create( dX + dLeftInset + dValueWidth - 1,					dY + dFullHeight + dValueHeight );			loaBack[3] = LocationImpl.create( dX + dLeftInset + dValueWidth - 1,					dY + dFullHeight + 1 );			ipr.fillPolygon( pre );			ipr.drawPolygon( pre );			Label tmpLa = (Label) EcoreUtil.copy( valueLa );			tmpLa.setOutline( null );			tmpLa.setBackground( null );			TextAlignment ta = TextAlignmentImpl.create( );			ta.setHorizontalAlignment( HorizontalAlignment.CENTER_LITERAL );			ta.setVerticalAlignment( VerticalAlignment.CENTER_LITERAL );			tre.setBlockAlignment( ta );			tre.setBlockBounds( BoundsImpl.create( dX + dLeftInset + 1, dY					+ dFullHeight					+ 1, dValueWidth - 2, dValueHeight - 1 ) );			tre.setLabel( tmpLa );			tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK );			ipr.drawText( tre );		}		// PROCESS 'SERIES LEVEL' TRIGGERS USING SOURCE='bs'		Trigger tg;		EList elTriggers = lg.getTriggers( );		Location[] loaHotspot = new Location[4];		double dTextStartX = tre.getLocation( ).getX( ) - 1;		loaHotspot[0] = LocationImpl.create( dTextStartX, dY );		loaHotspot[1] = LocationImpl.create( dTextStartX + dW, dY + 1 );		loaHotspot[2] = LocationImpl.create( dTextStartX + dW, dY				+ dItemHeight				+ dValueHeight );		loaHotspot[3] = LocationImpl.create( dTextStartX, dY				+ dItemHeight				+ dValueHeight );		if ( !elTriggers.isEmpty( ) )		{			final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createSeries( se ),					InteractionEvent.class );			for ( int t = 0; t < elTriggers.size( ); t++ )			{				tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) );				if ( tg.getCondition( ) == TriggerCondition.MOUSE_CLICK_LITERAL						|| tg.getCondition( ) == TriggerCondition.ONCLICK_LITERAL )				{					iev.addTrigger( tg );				}			}			final PolygonRenderEvent pre = (PolygonRenderEvent) ( (EventObjectCache) ipr ).getEventObject( StructureSource.createLegend( lg ),					PolygonRenderEvent.class );			pre.setPoints( loaHotspot );			iev.setHotSpot( pre );			ipr.enableInteraction( iev );		}		ScriptHandler.callFunction( sh,				ScriptHandler.AFTER_DRAW_LEGEND_ENTRY,				la );		getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_LEGEND_ENTRY,				la );	}