|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.preprocess.css.Converter
de.enough.polish.preprocess.css.CssConverter
public class CssConverter
Converts CSS files to Java-Code.
history
04-Jan-2004 - rob creation
| Field Summary | |
|---|---|
protected AbbreviationsGenerator |
abbreviationGenerator
|
protected CssAttributesManager |
attributesManager
|
protected ArrayList |
referencedStyles
|
| Fields inherited from class de.enough.polish.preprocess.css.Converter |
|---|
ANCHORS, colorConverter, STANDALONE_MODIFIER, STANDALONE_MODIFIER_NON_FINAL |
| Constructor Summary | |
|---|---|
CssConverter()
Creates a new CSS converter |
|
| Method Summary | |
|---|---|
void |
convertStyleSheet(StringList sourceCode,
StyleSheet styleSheet,
Device device,
Preprocessor preprocessor,
Environment env)
Converts a stylesheet to Java source code. |
protected CssAnimationSetting[] |
extractAnimationSettings(Style style)
|
protected String |
getAttributeValue(String groupName,
String attributeName,
Map group)
Retrieves a attribute value. |
protected String |
getColor(String value)
Retrieves the color value as a decimal integer value. |
protected String |
getStyleReference(String value,
Style parent,
StyleSheet styleSheet)
Gets a reference to another style. |
protected void |
processBackground(String backgroundName,
AttributesGroup group,
Style style,
ArrayList codeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
boolean isStandalone,
Environment env)
Creates the background-definition. |
protected void |
processBorder(String borderName,
AttributesGroup group,
Style style,
ArrayList codeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
boolean isStandalone,
Environment env)
Creates the border-definition. |
protected void |
processDefaultStyle(boolean defaultFontDefined,
boolean defaultBackgroundDefined,
boolean defaultBorderDefined,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
Processes the default style: |
protected void |
processFields(int defaultValue,
boolean includeVerticalHorizontal,
HashMap fields,
String groupName,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
Device device)
Processes the given fields - currently either "margins" or "paddings". |
protected void |
processFont(HashMap group,
String groupName,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
boolean isStandalone,
Environment environment)
Adds a font definition. |
protected void |
processLayout(AttributesGroup group,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
Environment env)
Creates the layout-declaration for the style. |
protected void |
processStyle(boolean declareVariable,
Style style,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
Processes the give style and includes the generated code to the codeList. |
protected void |
processStyle(Style style,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
Processes the give style and includes the generated code to the codeList. |
void |
setAttributesManager(CssAttributesManager attributesManager)
Sets the manager of CSS attributes. |
| Methods inherited from class de.enough.polish.preprocess.css.Converter |
|---|
getUrl, isAlphaColor, parseAnchor, parseBoolean, parseColor, parseFloat, parseInt, parseInt, parseStroke, print, setColorConverter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ArrayList referencedStyles
protected AbbreviationsGenerator abbreviationGenerator
protected CssAttributesManager attributesManager
| Constructor Detail |
|---|
public CssConverter()
| Method Detail |
|---|
public void setAttributesManager(CssAttributesManager attributesManager)
attributesManager - the manager for CSS attributes
public void convertStyleSheet(StringList sourceCode,
StyleSheet styleSheet,
Device device,
Preprocessor preprocessor,
Environment env)
sourceCode - the source code to which the generated code is appendedstyleSheet - the style sheetdevice - the current devicepreprocessor - a preprocessorenv - the environment
protected void processDefaultStyle(boolean defaultFontDefined,
boolean defaultBackgroundDefined,
boolean defaultBorderDefined,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
defaultFontDefined - true when the default font has been defined alreadydefaultBackgroundDefined - true when the default background has been defined alreadydefaultBorderDefined - true when the default border has been defined alreadycodeList - the list to which the declarations should be addedstyleSheet - the parent style sheetdevice - the device for which the style should be processedenvironment - the environment
protected void processStyle(Style style,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
style - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetdevice - the device for which the style should be processedenvironment - the environment
protected void processStyle(boolean declareVariable,
Style style,
ArrayList codeList,
ArrayList staticCodeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
Device device,
Environment environment)
style - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetdevice - the device for which the style should be processedenvironment - the environmentprotected CssAnimationSetting[] extractAnimationSettings(Style style)
style -
protected String getColor(String value)
value - the color
protected String getStyleReference(String value,
Style parent,
StyleSheet styleSheet)
value - the referenceparent - the parent stylestyleSheet - the sheet in which the style is embedded
protected void processLayout(AttributesGroup group,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
Environment env)
group - the layout directivestyle - the parent stylecodeList - the source codestyleSheet - the parent style sheet
protected void processBorder(String borderName,
AttributesGroup group,
Style style,
ArrayList codeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
boolean isStandalone,
Environment env)
borderName - the name of the bordergroup - the map containing the border informationstyle - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetisStandalone - true when a new public border-field should be created,
otherwise the border will be embedded in a style instantiation.
protected void processBackground(String backgroundName,
AttributesGroup group,
Style style,
ArrayList codeList,
boolean defineStylesOutside,
StyleSheet styleSheet,
boolean isStandalone,
Environment env)
backgroundName - the name of the backgroundgroup - the map containing the background informationstyle - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetisStandalone - true when a new public background-field should be created,
otherwise the background will be embedded in a style instantiation.
protected void processFont(HashMap group,
String groupName,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
boolean isStandalone,
Environment environment)
group - the font definitiongroupName - the name of this font - usually "font" or "labelFont"style - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetisStandalone - true when a new public font-field should be created,
otherwise the font will be embedded in a style instantiation.
protected String getAttributeValue(String groupName,
String attributeName,
Map group)
groupName - the name of the attribute-group, e.g. "font" or "background"attributeName - the name of the attribute, e.g. "color"group - the attribute group
protected void processFields(int defaultValue,
boolean includeVerticalHorizontal,
HashMap fields,
String groupName,
Style style,
ArrayList codeList,
StyleSheet styleSheet,
Device device)
defaultValue - the default value for unset fieldsincludeVerticalHorizontal - true when vertical and horizontal fields should
also be processed (this is the case for paddings).fields - the definition of the fieldsgroupName - the name of the groupstyle - the stylecodeList - the array list into which generated code is writtenstyleSheet - the parent style sheetdevice - the device for which the fields should be processed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||