} else if ( ScriptHandler.BEFORE_DRAW_LEGEND_ITEM.equals( name ) ) { javahandler.beforeDrawLegendItem( (LegendEntryRenderingHints) tmpArgs[0], (Bounds)tmpArgs[1], (IChartScriptContext) tmpArgs[2] ); } else if ( ScriptHandler.AFTER_DRAW_LEGEND_ITEM.equals( name ) ) { javahandler.afterDrawLegendItem( (LegendEntryRenderingHints) tmpArgs[0], (Bounds)tmpArgs[1], (IChartScriptContext) tmpArgs[2] );
	private final Object callJavaFunction( String name, Object[] oaArgs )	{		if ( javahandler == null )		{			return null;		}		Object[] tmpArgs = new Object[3];		if ( oaArgs.length > 0 )		{			tmpArgs[0] = oaArgs[0];		}		if ( oaArgs.length > 1 )		{			tmpArgs[1] = oaArgs[1];		}		if ( oaArgs.length > 2 )		{			tmpArgs[2] = oaArgs[2];		}		// use regular interface call instead of reflection to gain performance.		/*		 * if ( ScriptHandler.ON_PREPARE.equals( name ) ) {		 * javahandler.onPrepare( (Chart) tmpArgs[0], (IChartScriptContext)		 * tmpArgs[1] ); } else		 */// not supported yet		if ( ScriptHandler.BEFORE_DATA_SET_FILLED.equals( name ) )		{			javahandler.beforeDataSetFilled( (Series) tmpArgs[0],					(IDataSetProcessor) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DATA_SET_FILLED.equals( name ) )		{			javahandler.afterDataSetFilled( (Series) tmpArgs[0],					(DataSet) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_GENERATION.equals( name ) )		{			javahandler.beforeGeneration( (Chart) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.AFTER_GENERATION.equals( name ) )		{			javahandler.afterGeneration( (GeneratedChartState) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.BEFORE_RENDERING.equals( name ) )		{			javahandler.beforeRendering( (GeneratedChartState) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.AFTER_RENDERING.equals( name ) )		{			javahandler.afterRendering( (GeneratedChartState) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.BEFORE_DRAW_BLOCK.equals( name ) )		{			javahandler.beforeDrawBlock( (Block) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.AFTER_DRAW_BLOCK.equals( name ) )		{			javahandler.afterDrawBlock( (Block) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.BEFORE_DRAW_LEGEND_ENTRY.equals( name ) )		{			javahandler.beforeDrawLegendEntry( (Label) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.AFTER_DRAW_LEGEND_ENTRY.equals( name ) )		{			javahandler.afterDrawLegendEntry( (Label) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.BEFORE_DRAW_LEGEND_ITEM.equals( name ) )		{			javahandler.beforeDrawLegendItem( (LegendEntryRenderingHints) tmpArgs[0],					(Bounds)tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_LEGEND_ITEM.equals( name ) )		{			javahandler.afterDrawLegendItem( (LegendEntryRenderingHints) tmpArgs[0],					(Bounds)tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_SERIES.equals( name ) )		{			javahandler.beforeDrawSeries( (Series) tmpArgs[0],					(ISeriesRenderer) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_SERIES.equals( name ) )		{			javahandler.afterDrawSeries( (Series) tmpArgs[0],					(ISeriesRenderer) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_SERIES_TITLE.equals( name ) )		{			javahandler.beforeDrawSeriesTitle( (Series) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_SERIES_TITLE.equals( name ) )		{			javahandler.afterDrawSeriesTitle( (Series) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_MARKER_LINE.equals( name ) )		{			javahandler.beforeDrawMarkerLine( (Axis) tmpArgs[0],					(MarkerLine) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_MARKER_LINE.equals( name ) )		{			javahandler.afterDrawMarkerLine( (Axis) tmpArgs[0],					(MarkerLine) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_MARKER_RANGE.equals( name ) )		{			javahandler.beforeDrawMarkerRange( (Axis) tmpArgs[0],					(MarkerRange) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_MARKER_RANGE.equals( name ) )		{			javahandler.afterDrawMarkerRange( (Axis) tmpArgs[0],					(MarkerRange) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_DATA_POINT.equals( name ) )		{			javahandler.beforeDrawDataPoint( (DataPointHints) tmpArgs[0],					(Fill) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_DATA_POINT.equals( name ) )		{			javahandler.afterDrawDataPoint( (DataPointHints) tmpArgs[0],					(Fill) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_DATA_POINT_LABEL.equals( name ) )		{			javahandler.beforeDrawDataPointLabel( (DataPointHints) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_DATA_POINT_LABEL.equals( name ) )		{			javahandler.afterDrawDataPointLabel( (DataPointHints) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_FITTING_CURVE.equals( name ) )		{			javahandler.beforeDrawFittingCurve( (CurveFitting) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.AFTER_DRAW_FITTING_CURVE.equals( name ) )		{			javahandler.afterDrawFittingCurve( (CurveFitting) tmpArgs[0],					(IChartScriptContext) tmpArgs[1] );		}		else if ( ScriptHandler.BEFORE_DRAW_AXIS_LABEL.equals( name ) )		{			javahandler.beforeDrawAxisLabel( (Axis) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_AXIS_LABEL.equals( name ) )		{			javahandler.afterDrawAxisLabel( (Axis) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.BEFORE_DRAW_AXIS_TITLE.equals( name ) )		{			javahandler.beforeDrawAxisTitle( (Axis) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else if ( ScriptHandler.AFTER_DRAW_AXIS_TITLE.equals( name ) )		{			javahandler.afterDrawAxisTitle( (Axis) tmpArgs[0],					(Label) tmpArgs[1],					(IChartScriptContext) tmpArgs[2] );		}		else		{			assert false;			Method mtd = (Method) JAVA_FUNTION_MAP.get( name );			try			{				return mtd.invoke( javahandler, oaArgs );			}			catch ( Exception e )			{				logger.log( e );			}		}		return null;	}