System.out.println("Item.init(): contentWidth=" + this.contentWidth + ", itemWidth=" + this.itemWidth + ", backgroundWidth=" + this.backgroundWidth);
	protected void init( int firstLineWidth, int lineWidth ) {		//#debug		System.out.println("intialising item " + this.getClass().getName() );		if (this.style != null && !this.isStyleInitialised) {			setStyle( this.style );		}		//#ifdef polish.useDynamicStyles			else if (this.style == null) {				initStyle();			}		//#else			else if (this.style == null && !this.isStyleInitialised) {				//#debug				System.out.println("Setting default style for item " + getClass().getName() );				setStyle( StyleSheet.defaultStyle );			}		//#endif		int labelWidth = 0;		int labelHeight = 0;		if (this.label != null) {			if (!this.label.isInitialised) {				this.label.init( firstLineWidth, lineWidth );			}			labelWidth = this.label.itemWidth;			labelHeight = this.label.itemHeight;		}		// calculate content width and content height:		int noneContentWidth =  			 	this.marginLeft + this.borderWidth + this.paddingLeft 				+ this.paddingRight + this.borderWidth + this.marginRight;		//#ifdef polish.useBeforeStyle			noneContentWidth += this.beforeWidth;		//#endif		//#ifdef polish.useAfterStyle			noneContentWidth += this.afterWidth;		//#endif		/*		if (noneContentWidth >= firstLineWidth) {			System.out.println("INVALID NONE CONTENT WIDTH=" + noneContentWidth);		}		*/		//#ifdef polish.css.max-width			int firstLineAdjustedWidth = firstLineWidth;			int lineAdjustedWidth = lineWidth;			if (this.maximumWidth != 0 ) {				if (firstLineAdjustedWidth > this.maximumWidth ) {					firstLineAdjustedWidth = this.maximumWidth;				} 				if (lineAdjustedWidth > this.maximumWidth ) {					lineAdjustedWidth = this.maximumWidth;				}			}			int firstLineContentWidth = firstLineAdjustedWidth - noneContentWidth;			int availableContentWidth = lineAdjustedWidth - noneContentWidth;		//#else			//# int firstLineContentWidth = firstLineWidth - noneContentWidth;			//# int availableContentWidth = lineWidth - noneContentWidth;		//#endif		// initialise content by subclass:		initContent( firstLineContentWidth, availableContentWidth );		if (this.contentWidth == 0 && this.contentHeight == 0) {			this.itemWidth = labelWidth;			this.itemHeight = labelHeight;			this.backgroundHeight = 0;			this.backgroundWidth = 0;			this.isInitialised = true;			return;		}		this.itemWidth = noneContentWidth + this.contentWidth;		//#ifdef polish.css.min-width		if (this.itemWidth < this.minimumWidth ) {			this.itemWidth = this.minimumWidth;		}		//#endif		int cHeight = this.contentHeight;		//#ifdef polish.useBeforeStyle			if (this.contentHeight < this.beforeHeight) {				cHeight = this.beforeHeight;			}		//#endif		//#ifdef polish.useAfterStyle			if (this.contentHeight < this.afterHeight) {				cHeight = this.afterHeight;			}		//#endif		int noneContentHeight = this.marginTop + this.borderWidth + this.paddingTop 			  + this.paddingBottom + this.borderWidth + this.marginBottom;		if (this.itemWidth + labelWidth <= lineWidth) {			// label and content fit on one row:			this.itemWidth += labelWidth;			this.useSingleRow = true;			if (this.label != null) {				if ( (this.label.layout & LAYOUT_NEWLINE_AFTER) != 0 || ((this.layout & LAYOUT_NEWLINE_BEFORE) == LAYOUT_NEWLINE_BEFORE )) {					this.useSingleRow = false;					cHeight += labelHeight;				}			}			if ( cHeight + noneContentHeight < labelHeight ) {				cHeight = labelHeight - noneContentHeight;			}		} else {			this.useSingleRow = false;			cHeight += labelHeight;		}		if ( this.isLayoutExpand ) {			this.itemWidth = lineWidth;			//#ifdef polish.css.max-width				if (this.maximumWidth != 0 && lineWidth > this.maximumWidth ) {					this.itemWidth = this.maximumWidth;				}			//#endif		} else if (this.itemWidth > lineWidth) {			this.itemWidth = lineWidth;		}		if (cHeight + noneContentHeight < this.minimumHeight) {			cHeight = this.minimumHeight - noneContentHeight;		}		//#if polish.css.max-height			if (this.maximumHeight != 0 && cHeight + noneContentHeight > this.maximumHeight) {				cHeight = this.maximumHeight - noneContentHeight;			}		//#endif		this.itemHeight = cHeight + noneContentHeight;		if (this.useSingleRow) {			this.backgroundWidth = this.itemWidth - this.marginLeft - this.marginRight - labelWidth;			this.backgroundHeight = cHeight							  + noneContentHeight							  - this.marginTop							  - this.marginBottom;		} else {			this.backgroundWidth = this.itemWidth - this.marginLeft - this.marginRight;			this.backgroundHeight = cHeight							  + noneContentHeight							  - this.marginTop							  - this.marginBottom							  - labelHeight;		}		this.isInitialised = true;	}