templateDimension.setDimension( con.getContentWidth( ), con .getContentHeight( ) );  TemplateArea templateArea = (TemplateArea) AreaFactory .createTemplateArea( autoText, templateDimension ); con.addChild( templateArea );
templateDimension.setDimension( templateContainer.getContentWidth( ), templateContainer.getContentHeight( ) ); AbstractArea templateArea = createTemplateArea( autoText, templateDimension ); templateContainer.addChild( templateArea );
	public boolean layoutChildren( )	{		ContainerArea con = (ContainerArea) AreaFactory.createInlineContainer(				autoText, true, true );		int width = getDimensionValue( autoText.getWidth( ) );		int height = getDimensionValue( autoText.getHeight( ) );		IStyle style = autoText.getComputedStyle( );		int hMarginWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_MARGIN_LEFT ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_MARGIN_RIGHT ) );		int hBorderWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_BORDER_LEFT_WIDTH ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_BORDER_RIGHT_WIDTH ) );		int hPaddingWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_PADDING_LEFT ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_PADDING_RIGHT ) );		int vMarginWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_MARGIN_TOP ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_MARGIN_BOTTOM ) );		int vBorderWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_BORDER_TOP_WIDTH ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_BORDER_BOTTOM_WIDTH ) );		int vPaddingWidth = getDimensionValue( style				.getProperty( StyleConstants.STYLE_PADDING_TOP ) )				+ getDimensionValue( style						.getProperty( StyleConstants.STYLE_PADDING_BOTTOM ) );		IStyle areaStyle = con.getStyle( );		if ( width <= 0 )		{			width = PropertyUtil.getDimensionValue( style.getFontSize( ) ) * 4					+ hMarginWidth + hBorderWidth + hPaddingWidth;		}		else		{ // remove the margin if the margin width is larger than the max			// avaliable width.			if ( hMarginWidth > maxWidth )			{				areaStyle.setProperty( IStyle.STYLE_MARGIN_LEFT,						IStyle.NUMBER_0 );				areaStyle.setProperty( IStyle.STYLE_MARGIN_RIGHT,						IStyle.NUMBER_0 );				hMarginWidth = 0;			}			// remove the border if the border width is larger than the			// dimension width.			if ( hBorderWidth > width )			{				areaStyle.setProperty( IStyle.STYLE_BORDER_LEFT_WIDTH,						IStyle.NUMBER_0 );				areaStyle.setProperty( IStyle.STYLE_BORDER_RIGHT_WIDTH,						IStyle.NUMBER_0 );				hBorderWidth = 0;			}		}		if ( height <= 0 )		{			height = (int) ( PropertyUtil.getDimensionValue( style					.getFontSize( ) ) * 1.35 )					+ vMarginWidth + vBorderWidth + vPaddingWidth;		}		int maxContentWidth = maxWidth - hMarginWidth;		width = ( width > maxContentWidth ) ? maxContentWidth : width;		Dimension d = new Dimension( );		d.setDimension( width, height );		con.setWidth( d.getWidth( ) );		con.setHeight( d.getHeight( ) );		Dimension templateDimension = new Dimension( );		templateDimension.setDimension( con.getContentWidth( ), con				.getContentHeight( ) );		TemplateArea templateArea = (TemplateArea) AreaFactory				.createTemplateArea( autoText, templateDimension );		con.addChild( templateArea );		templateArea				.setPosition(						getDimensionValue( areaStyle								.getProperty( StyleConstants.STYLE_BORDER_LEFT_WIDTH ) ),						getDimensionValue( areaStyle								.getProperty( StyleConstants.STYLE_BORDER_TOP_WIDTH ) ) );		parent.addArea( con );		return false;	}