processBackground(groupName, group, null, codeList, styleSheet, true );
processBorder(groupName, group, null, codeList, styleSheet, true );
	public void convertStyleSheet( StringList sourceCode, 								   StyleSheet styleSheet, 								   Device device,								   Preprocessor preprocessor ) 	{		// search for the position to include the style-sheet definitions:		int index = -1;		while (sourceCode.next()) {			String line = sourceCode.getCurrent();			if (INCLUDE_MARK.equals(line)) {				index = sourceCode.getCurrentIndex() + 1;				break;			}		}		if (index == -1) {			throw new BuildException("Unable to modify SytleSheet.java, include point [" + INCLUDE_MARK + "] not found.");		}		// okay start with the creation of source code:		ArrayList codeList = new ArrayList();		this.referencedStyles = new ArrayList();		// initialise the syle sheet:		styleSheet.inherit();		// set the color-definitions:		this.colorConverter.setTemporaryColors( styleSheet.getColors() );		// add the font-definitions:		boolean defaultFontDefined = false;		boolean defaultLabelDefined = false;		HashMap fonts = styleSheet.getFonts();		Set keys = fonts.keySet();		for (Iterator iter = keys.iterator(); iter.hasNext();) {			String groupName = (String) iter.next();			if ("default".equals(groupName)) {				defaultFontDefined = true;				HashMap group = (HashMap) fonts.get( groupName );				processFont(group, groupName, null, codeList, styleSheet, true );			} else if ("label".equals(groupName)) {				defaultLabelDefined = true;				HashMap group = (HashMap) fonts.get( groupName );				processLabel(group, "default", null, codeList, styleSheet, true );			} else {				HashMap group = (HashMap) fonts.get( groupName );				processFont(group, groupName, null, codeList, styleSheet, true );			}		}				// add the backgrounds-definition:		boolean defaultBackgroundDefined = false;		HashMap backgrounds = styleSheet.getBackgrounds();		keys = backgrounds.keySet();		for (Iterator iter = keys.iterator(); iter.hasNext();) {			String groupName = (String) iter.next();			if ("default".equals(groupName)) {				defaultBackgroundDefined = true;			} 			HashMap group = (HashMap) backgrounds.get( groupName );			processBackground(groupName, group, null, codeList, styleSheet, true );		}				// add the borders-definition:		boolean defaultBorderDefined = false;		HashMap borders = styleSheet.getBorders();		keys = borders.keySet();		for (Iterator iter = keys.iterator(); iter.hasNext();) {			String groupName = (String) iter.next();			if ("default".equals(groupName)) {				defaultBorderDefined = true;			} 			HashMap group = (HashMap) borders.get( groupName );			processBackground(groupName, group, null, codeList, styleSheet, true );		}		String test = preprocessor.getVariable("polish.licence");		if ( "GPL".equals(test) ) {			// GPL licence is fine.		} else if (test == null || test.length() != 7) {			throw new BuildException("Encountered invalid licence.");		} else {			try {				Long.parseLong(test, 0x10);			} catch (Exception e) {				throw new BuildException("Encountered invalid licence.");			}		}				// add the default style:		processDefaultStyle( defaultFontDefined, defaultLabelDefined, 				defaultBackgroundDefined, defaultBorderDefined,				codeList, styleSheet, device );						String[] styleNames = styleSheet.getUsedStyleNames();		//System.out.println("processing [" + styleNames.length + "] styles.");		codeList.add("\t//normal used styles:");		for (int i = 0; i < styleNames.length; i++) {			String styleName = styleNames[i];			if (!styleName.equals("default")) {				Style style = styleSheet.getStyle( styleName );				processStyle( style, codeList, styleSheet, device );			}		}		codeList.add( STANDALONE_MODIFIER + "String lic=\"" + test +"\";");				// process referenced styles:		Style[] styles = (Style[]) this.referencedStyles.toArray( new Style[ this.referencedStyles.size() ] );		if (styles.length > 0) {			codeList.add("\t//referenced styles:");			for (int i = 0; i < styles.length; i++) {				Style style = styles[i];				processStyle( style, codeList, styleSheet, device );			}		}				// check if fullscreen mode is enabled with menu:		if (preprocessor.hasSymbol("polish.useMenuFullScreen") 			&& (device.getCapability("polish.classes.fullscreen") != null) ) {			if (styleSheet.getStyle("menu" ) == null) {				System.out.println("Warning: CSS style [menu] not found, you should define it for designing the FullScreen-menu.");			} else {				this.referencedStyles.add(styleSheet.getStyle("menu" ));			}		}				// process dynamic styles:		if (styleSheet.containsDynamicStyles()) {			codeList.add("\t//dynamic styles:");			Style[] dynamicStyles = styleSheet.getDynamicStyles(); 			for (int i = 0; i < dynamicStyles.length; i++) {				Style style = dynamicStyles[i];				processStyle( style, codeList, styleSheet, device );				this.referencedStyles.add( style );			}		}				// register referenced and dynamic styles:		if (this.referencedStyles.size() > 0) {			codeList.add("\tstatic { \t//register referenced and dynamic styles:");			styles = (Style[]) this.referencedStyles.toArray( new Style[ this.referencedStyles.size() ] );			for (int i = 0; i < styles.length; i++) {				Style style = styles[i];				codeList.add("\t\tstylesByName.put( \"" + style.getSelector() + "\", " + style.getStyleName() + "Style );");			}			codeList.add("\t}");		}				// create focused style if necessary:		Style focusedStyle = styleSheet.getStyle("focused"); 		if (focusedStyle == null) {			System.out.println("Warning: CSS-Style [focused] not found, now using the default style instead. If you use Forms or Lists, you should define the style [focused].");			codeList.add( STANDALONE_MODIFIER + "Style focusedStyle = defaultStyle;\t// the focused-style is not defined.");		} else {			processStyle( focusedStyle, codeList, styleSheet, device );		}				// generate general warnings and hints:		// check if title style has beend defined:		if (styleSheet.getStyle("title" ) == null) {			System.out.println("Warning: CSS style [title] not found, you should define it for designing the titles of screens.");		}						// now insert the created source code into the source of the polish-StyleSheet.java:		String[] code = (String[]) codeList.toArray( new String[ codeList.size()]);		sourceCode.insert(code);	}