IDisplayServer ids = ChartDlg.getDisplayServer( );
IDisplayServer ids = ChartUIUtil.getDisplayServer( );
	public Dimension getPreferredSize( int wHint, int hHint )	{		if ( prefSize != null )		{			return prefSize;		}		DimensionHandle dimWidth = ( (ExtendedItemHandle) crii.getHandle( ) ).getWidth( );		DimensionHandle dimHeight = ( (ExtendedItemHandle) crii.getHandle( ) ).getHeight( );		boolean isPerWidth = DesignChoiceConstants.UNITS_PERCENTAGE.equals( dimWidth.getUnits( ) );		boolean isPerHeight = DesignChoiceConstants.UNITS_PERCENTAGE.equals( dimHeight.getUnits( ) );		Dimension dim = getSize( ).getCopy( );		if ( isPerWidth && wHint != -1 )		{			// dim.width = Math.min( dim.width, wHint );			// ?? TODO calculate the percentage value here?			dim.width = (int) ( wHint * dimWidth.getMeasure( ) / 100d );		}		if ( isPerHeight && hHint != -1 )		{			// dim.height = Math.min( dim.height, hHint );			// ?? TODO calculate the percentage value here?			dim.height = (int) ( hHint * dimHeight.getMeasure( ) / 100d );		}		// ?? refresh the model size.		// TODO this is a temp solution, better not refresh model here. and this		// can not handle all the cases.		setSize( dim.width, dim.height );		Chart cm = (Chart) crii.getProperty( "chart.instance" ); //$NON-NLS-1$		if ( cm != null )		{			IDisplayServer ids = ChartDlg.getDisplayServer( );			cm.getBlock( )					.getBounds( )					.setWidth( ChartUtil.convertPixelsToPoints( ids, dim.width ) );			cm.getBlock( )					.getBounds( )					.setHeight( ChartUtil.convertPixelsToPoints( ids,							dim.height ) );		}		return dim;	}