content.setDimension( maxContentWidth, (int) ( maxContentWidth / content.getRatio( ) ) ); } if ( borderWidth > content.getWidth( ) ) {  areaStyle.setProperty( IStyle.STYLE_BORDER_LEFT_WIDTH, IStyle.NUMBER_0 ); areaStyle.setProperty( IStyle.STYLE_BORDER_RIGHT_WIDTH, IStyle.NUMBER_0 );
areaStyle.setProperty(IStyle.STYLE_BORDER_LEFT_WIDTH, IStyle.NUMBER_0); areaStyle.setProperty(IStyle.STYLE_BORDER_RIGHT_WIDTH, IStyle.NUMBER_0);
	protected void init( )	{		assert ( content instanceof IImageContent );		image = (IImageContent) content;		maxWidth = parent.getMaxAvaWidth( );		Dimension content = getSpecifiedDimension( image );		IStyle style = image.getComputedStyle( );		root = (ContainerArea) AreaFactory.createInlineContainer( image, true,				true );		int marginWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_MARGIN_LEFT ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_MARGIN_RIGHT ) );		int borderWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_BORDER_LEFT_WIDTH ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_BORDER_RIGHT_WIDTH ) );		IStyle areaStyle = root.getStyle( );		if ( marginWidth > maxWidth )		{			// remove margin			areaStyle.setMarginLeft( "0" ); //$NON-NLS-1$			areaStyle.setMarginRight( "0" ); //$NON-NLS-1$			marginWidth = 0;		}		int maxContentWidth = maxWidth - marginWidth;		if ( content.getWidth( ) > maxContentWidth )		{			content.setDimension( maxContentWidth,					(int) ( maxContentWidth / content.getRatio( ) ) );		}		if ( borderWidth > content.getWidth( ) )		{			// remove border			areaStyle.setProperty( IStyle.STYLE_BORDER_LEFT_WIDTH,					IStyle.NUMBER_0 );			areaStyle.setProperty( IStyle.STYLE_BORDER_RIGHT_WIDTH,					IStyle.NUMBER_0 );			borderWidth = 0;		}		ImageArea imageArea = (ImageArea) AreaFactory.createImageArea( image,				content );		root.addChild( imageArea );		imageArea				.setPosition(						getDimensionValue( areaStyle								.getProperty( StyleConstants.STYLE_BORDER_LEFT_WIDTH ) ),						getDimensionValue( areaStyle								.getProperty( StyleConstants.STYLE_BORDER_TOP_WIDTH ) ) );		root.setWidth( content.getWidth( ) );		root.setHeight( content.getHeight( ) );		// padding for image is useless, remove padding		removePadding( areaStyle );		imageArea.setWidth( root.getContentWidth( ) );		imageArea.setHeight( root.getContentHeight( ) );	}