this.titleHeight = this.title.getItemHeight( getWidth(), getWidth() );
int width = this.screenWidth - (this.marginLeft + this.marginRight); this.titleHeight = this.title.getItemHeight( width, width ); } else {   if (this.title != null && this.title.isInitialised) { this.title.isInitialised = false; int width = this.screenWidth - (this.marginLeft + this.marginRight); this.titleHeight = this.title.getItemHeight( width, width ); }
	public void setStyle(Style style) {		//#debug		System.out.println("Setting screen-style for " + getClass().getName() );		this.style = style;		this.background = style.background;		this.border = style.border;		this.marginTop = style.marginTop;		this.marginBottom = style.marginBottom;		this.marginLeft = style.marginRight;		this.marginRight = style.marginRight;		if (this.container != null) {			// use the same style for the container - but ignore the background and border settings:			this.container.setStyle(style, true);		}		this.isLayoutVCenter = (( style.layout & Item.LAYOUT_VCENTER ) == Item.LAYOUT_VCENTER);		this.isLayoutBottom = ! this.isLayoutVCenter 							&& (( style.layout & Item.LAYOUT_BOTTOM ) == Item.LAYOUT_BOTTOM);		//#if polish.css.scrollindicator-up-image			String scrollUpUrl = style.getProperty("scrollindicator-up-image");			if (scrollUpUrl != null) {				try {					this.scrollIndicatorUpImage = StyleSheet.getImage(scrollUpUrl, null, true);				} catch (IOException e) {					//#debug error					System.out.println("Unable to load scroll up image" + e );				}			} else {				this.scrollIndicatorUpImage = null;			}		//#endif				//#if polish.css.scrollindicator-down-image			String scrollDownUrl = style.getProperty("scrollindicator-down-image");			if (scrollDownUrl != null) {				try {					this.scrollIndicatorDownImage = StyleSheet.getImage(scrollDownUrl, null, true);				} catch (IOException e) {					//#debug error					System.out.println("Unable to load scroll down image" + e );				}			} else {				this.scrollIndicatorDownImage = null;			}		//#endif				//#if polish.css.scrollindicator-up-image && polish.css.scrollindicator-down-image			if (this.scrollIndicatorUpImage != null && this.scrollIndicatorDownImage != null) {				int height = this.scrollIndicatorUpImage.getHeight() + this.scrollIndicatorDownImage.getHeight();				int width = Math.max( this.scrollIndicatorUpImage.getWidth(), this.scrollIndicatorDownImage.getWidth() );				this.scrollIndicatorWidth = width;				this.scrollIndicatorX = this.screenWidth / 2 - width / 2;				//#ifdef tmp.menuFullScreen					//#ifdef tmp.useExternalMenuBar						this.scrollIndicatorY = this.fullScreenHeight - this.menuBar.marginBottom + 1 - height;					//#else						this.scrollIndicatorY = this.fullScreenHeight - height - 1;					//#endif									//#elif polish.vendor.Siemens					// set the position of scroll indicator for Siemens devices 					// on the left side, so that the menu-indicator is visible:					this.scrollIndicatorWidth = width;					this.scrollIndicatorX = 0;					this.scrollIndicatorY = this.screenHeight - height - 1;				//#else					// set position of scroll indicator:					this.scrollIndicatorWidth = width;					this.scrollIndicatorX = this.screenWidth - width - 1;					this.scrollIndicatorY = this.screenHeight - height - 1;				//#endif								}		//#endif		//#ifdef polish.css.scrollindicator-color			Integer scrollIndicatorColorInt = style.getIntProperty( "scrollindicator-color" );			if (scrollIndicatorColorInt != null) {				this.scrollIndicatorColor = scrollIndicatorColorInt.intValue();			}		//#endif		//#if tmp.usingTitle && polish.css.title-style			this.titleStyle = (Style) style.getObjectProperty("title-style");			if (this.titleStyle != null && this.title != null) {				this.title.setStyle(this.titleStyle);				//#ifdef polish.ScreenWidth:defined					//#= this.titleHeight = this.title.getItemHeight(${polish.ScreenWidth}, ${polish.ScreenWidth});				//#else					this.titleHeight = this.title.getItemHeight( getWidth(), getWidth() );				//#endif			}		//#endif					//#ifdef polish.css.foreground-image			String foregroundImageUrl = this.style.getProperty("foreground-image");			if (foregroundImageUrl == null) {				this.foregroundImage = null;			} else {				try {					this.foregroundImage = StyleSheet.getImage(foregroundImageUrl, null,true);					//#ifdef polish.css.foreground-x						Integer xInteger = this.style.getIntProperty("foreground-x");						if (xInteger != null) {							this.foregroundX = xInteger.intValue();						}					//#endif					//#ifdef polish.css.foreground-y						Integer yInteger = this.style.getIntProperty("foreground-y");						if (yInteger != null) {							this.foregroundY = yInteger.intValue();						}					//#endif				} catch (IOException e) {					//#debug error					System.out.println("Unable to load foreground-image [" + foregroundImageUrl + "]: " + e);				}			}		//#endif		//#if polish.css.clip-screen-info			Boolean clipScreenInfoBool = style.getBooleanProperty( "clip-screen-info" );			if (clipScreenInfoBool != null) {				this.clipScreenInfo = clipScreenInfoBool.booleanValue();			}		//#endif			//#if polish.css.menubar-style  && tmp.useExternalMenuBar			Style menuBarStyle = (Style) style.getObjectProperty("menubar-style");			if (menuBarStyle != null) {				this.menuBar.setStyle( menuBarStyle );			}		//#endif		//#ifndef polish.skipTicker			//#if polish.css.ticker-position				Integer tickerPositionInt = style.getIntProperty("ticker-position");				if (tickerPositionInt != null) {					this.paintTickerAtTop = (tickerPositionInt.intValue() == TICKER_POSITION_TOP);				}			//#endif		//#endif		}