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