&& rtc.getLegendItemLayoutHints( ) != null && rtc.getLegendItemLayoutHints( ).getCachedSize( ) != null )
&& rtc.getLegendLayoutHints( ) != null && rtc.getLegendLayoutHints( ).getLegendSize( ) != null )
	public final Size getPreferredSize( IDisplayServer xs, Chart cm,			RunTimeContext rtc ) throws ChartException	{		Size sz;		// TODO check context consistency.		if ( rtc != null				&& rtc.getLegendItemLayoutHints( ) != null				&& rtc.getLegendItemLayoutHints( ).getCachedSize( ) != null )		{			sz = rtc.getLegendItemLayoutHints( ).getCachedSize( );		}		else		{			// COMPUTE THE LEGEND CONTENT (TO ENSURE THAT THE PREFERRED SIZE IS			// OBTAINED)			final LegendBuilder lb = new LegendBuilder( );			final SeriesDefinition[] seda = cm.getSeriesForLegend( );			sz = lb.compute( xs, cm, seda, rtc );		}		// CONVERT TO POINTS		sz = sz.scaleInstance( 72d / xs.getDpiResolution( ) );		final Insets ins = this.getInsets( );		sz.setWidth( sz.getWidth( ) + ins.getLeft( ) + ins.getRight( ) );		sz.setHeight( sz.getHeight( ) + ins.getTop( ) + ins.getBottom( ) );		return sz;	}