diff options
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style')
11 files changed, 571 insertions, 0 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java new file mode 100644 index 000000000000..4d61bc9ff871 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java @@ -0,0 +1,64 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.font.FontStyleKeys; +import org.jfree.layouting.input.style.values.CSSStringValue; +import org.jfree.layouting.input.style.values.CSSStringType; +import org.jfree.layouting.input.style.values.CSSValue; +import org.jfree.layouting.input.style.values.CSSValueList; + +public class FontFamilyGenericMapper implements StyleMapper +{ + + public FontFamilyGenericMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); + if (!(value instanceof CSSValueList)) + { + final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + new CSSValueList(new CSSValue[] + { + cssVal + })); + } + else + { + final CSSValueList list = (CSSValueList) value; + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + CSSValueList.insertLast(list, value)); + } + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java new file mode 100644 index 000000000000..bde78e2ed0bf --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java @@ -0,0 +1,64 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.values.CSSStringValue; +import org.jfree.layouting.input.style.values.CSSStringType; +import org.jfree.layouting.input.style.values.CSSValue; +import org.jfree.layouting.input.style.values.CSSValueList; +import org.jfree.layouting.input.style.keys.font.FontStyleKeys; + +public class FontFamilyMapper implements StyleMapper +{ + + public FontFamilyMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); + if (!(value instanceof CSSValueList)) + { + final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + new CSSValueList(new CSSValue[] + { + cssVal + })); + } + else + { + final CSSValueList list = (CSSValueList) value; + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + CSSValueList.insertFirst(list, value)); + } + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java new file mode 100644 index 000000000000..2e8ed93c7f3b --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.values.CSSStringValue; +import org.jfree.layouting.input.style.values.CSSStringType; +import org.jfree.layouting.input.style.keys.font.FontStyleKeys; + +public class FontNameMapper implements StyleMapper +{ + + public FontNameMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValue(FontStyleKeys.FONT_NAME, + new CSSStringValue(CSSStringType.STRING, attrValue)); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java new file mode 100644 index 000000000000..93de4f494104 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.font.FontStyleKeys; +import org.jfree.layouting.input.style.values.CSSConstant; + +public class FontPitchMapper extends OneOfConstantsMapper +{ + + public FontPitchMapper() + { + super(FontStyleKeys.FONT_PITCH); + addMapping("variable", new CSSConstant("variable")); + addMapping("fixed", new CSSConstant("fixed")); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java new file mode 100644 index 000000000000..8d5070ab59e9 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.font.FontStyleKeys; + +public class FontReliefMapper implements StyleMapper +{ + + public FontReliefMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java new file mode 100644 index 000000000000..83f2e576bcea --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; + +public class TextEmphasizeMapper implements StyleMapper +{ + + public TextEmphasizeMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString("font-emphasize", attrValue); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java new file mode 100644 index 000000000000..091ae5f57286 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java @@ -0,0 +1,53 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; +import org.jfree.layouting.input.style.values.CSSColorValue; +import org.jfree.layouting.util.ColorUtil; + +public class TextUnderlineColorMapper implements StyleMapper +{ + + public TextUnderlineColorMapper() + { + } + + public void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule) + { + final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); + if (cv != null) + { + targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv); + } + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java new file mode 100644 index 000000000000..16f31d192e92 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; +import org.jfree.layouting.input.style.keys.text.TextDecorationStyle; + +public class TextUnderlineStyleMapper extends OneOfConstantsMapper +{ + + public TextUnderlineStyleMapper() + { + super(TextStyleKeys.TEXT_UNDERLINE_STYLE); + addMapping("none", TextDecorationStyle.NONE); + addMapping("solid", TextDecorationStyle.SOLID); + addMapping("dotted", TextDecorationStyle.DOTTED); + addMapping("dash", TextDecorationStyle.DASHED); + addMapping("long-dash", TextDecorationStyle.LONG_DASH); + addMapping("dot-dash", TextDecorationStyle.DOT_DASH); + addMapping("dot-dot-dash", TextDecorationStyle.DOT_DOT_DASH); + addMapping("wave", TextDecorationStyle.WAVE); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java new file mode 100644 index 000000000000..92846ba947e8 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.border.BorderWidth; +import org.jfree.layouting.input.style.keys.text.TextDecorationWidth; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; +import org.jfree.layouting.input.style.values.CSSAutoValue; +import org.jfree.layouting.input.style.values.CSSValue; + +public class TextUnderlineWidthMapper extends OneOfConstantsMapper +{ + + public TextUnderlineWidthMapper() + { + super(TextStyleKeys.TEXT_UNDERLINE_WIDTH); + addMapping("auto", CSSAutoValue.getInstance()); + addMapping("normal", BorderWidth.MEDIUM); + addMapping("bold", TextDecorationWidth.BOLD); + addMapping("thin", BorderWidth.THIN); + addMapping("dash", TextDecorationWidth.DASH); + addMapping("medium", BorderWidth.MEDIUM); + addMapping("thick", BorderWidth.THICK); + } + + public void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule) + { + if (attrName == null) + { + throw new NullPointerException(); + } + + final CSSValue value = lookupMapping(attrValue); + if (value != null) + { + targetRule.setPropertyValue(getStyleKey(), value); + } + else + // percent + // positive integer + // positive length + { + targetRule.setPropertyValueAsString(getStyleKey(), attrValue); + } + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java new file mode 100644 index 000000000000..f11dc31a3c37 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.text.TextDecorationMode; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; + +public class TextUnderlineWordMode extends OneOfConstantsMapper +{ + + public TextUnderlineWordMode() + { + super(TextStyleKeys.TEXT_UNDERLINE_MODE); + addMapping("continuous", TextDecorationMode.CONTINUOUS); + addMapping("skip-white-space", TextDecorationMode.SKIP_WHITE_SPACE); + } +} diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java new file mode 100644 index 000000000000..aff90e41ee11 --- /dev/null +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.report.pentaho.parser.stylemapper.style; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.line.LineStyleKeys; +import org.jfree.layouting.input.style.values.CSSAutoValue; +import org.jfree.layouting.input.style.values.CSSConstant; + +public class VerticalAlignMapper extends OneOfConstantsMapper +{ + + public VerticalAlignMapper() + { + super(LineStyleKeys.VERTICAL_ALIGN); + addMapping("top", new CSSConstant("top")); + addMapping("bottom", new CSSConstant("bottom")); + addMapping("middle", new CSSConstant("middle")); + addMapping("baseline", new CSSConstant("baseline")); + addMapping("auto", CSSAutoValue.getInstance()); + } +} |