diff options
Diffstat (limited to 'reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper')
22 files changed, 1359 insertions, 0 deletions
diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java new file mode 100644 index 000000000000..64d328fb996f --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java @@ -0,0 +1,84 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: OneOfConstantsMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper; + +import java.util.HashMap; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.StyleKey; +import org.jfree.layouting.input.style.values.CSSValue; + +public abstract class OneOfConstantsMapper implements StyleMapper +{ + private StyleKey styleKey; + private HashMap mappings; + + protected OneOfConstantsMapper (StyleKey styleKey) + { + this.styleKey = styleKey; + this.mappings = new HashMap(); + } + + public void addMapping (String value, CSSValue target) + { + mappings.put(value, target); + } + + public void updateStyle (String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + final CSSValue value = lookupMapping(attrValue); + if (value != null) + { + targetRule.setPropertyValue(styleKey, value); + } + } + + public StyleKey getStyleKey () + { + return styleKey; + } + + protected CSSValue lookupMapping (String attrValue) + { + return (CSSValue) mappings.get(attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java new file mode 100644 index 000000000000..2c026242bb52 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextAreaVerticalAlignMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.draw; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; +import org.jfree.layouting.input.style.values.CSSAutoValue; +import org.jfree.layouting.input.style.values.CSSConstant; + +public class TextAreaVerticalAlignMapper extends OneOfConstantsMapper +{ + public TextAreaVerticalAlignMapper () + { + super (BoxStyleKeys.BOX_VERTICAL_ALIGN); + addMapping("top", new CSSConstant("top")); + addMapping("bottom", new CSSConstant("bottom")); + addMapping("middle", new CSSConstant("middle")); + addMapping("justify", new CSSConstant("justify")); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java new file mode 100644 index 000000000000..64e05b0b68c5 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BackgroundColorMapper.java @@ -0,0 +1,63 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: BackgroundColorMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.border.BorderStyleKeys; +import org.jfree.layouting.input.style.values.CSSColorValue; +import org.jfree.layouting.util.ColorUtil; + +public class BackgroundColorMapper implements StyleMapper +{ + public BackgroundColorMapper () + { + } + + public void updateStyle (String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); + if (cv != null) + { + targetRule.setPropertyValue(BorderStyleKeys.BACKGROUND_COLOR, cv); + } + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java new file mode 100644 index 000000000000..e8594c939dc6 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/BorderRightMapper.java @@ -0,0 +1,68 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: BorderRightMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +/* + * BorderRightMapper.java + * + * Created on 16. Februar 2007, 13:00 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package com.sun.star.report.pentaho.parser.stylemapper.fo; +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +/** + * + * @author oj93728 + */ +public class BorderRightMapper implements StyleMapper +{ + + /** Creates a new instance of BorderRightMapper */ + public BorderRightMapper() + { + } + public void updateStyle (String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(attrName, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java new file mode 100644 index 000000000000..64596d05306d --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/ColorMapper.java @@ -0,0 +1,63 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ColorMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.color.ColorStyleKeys; +import org.jfree.layouting.input.style.values.CSSColorValue; +import org.jfree.layouting.util.ColorUtil; + +public class ColorMapper implements StyleMapper +{ + public ColorMapper () + { + } + + public void updateStyle (String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); + if (cv != null) + { + targetRule.setPropertyValue(ColorStyleKeys.COLOR, cv); + } + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java new file mode 100644 index 000000000000..ceafc23a99b6 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontSizeMapper.java @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontSizeMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +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 FontSizeMapper implements StyleMapper +{ + public FontSizeMapper () + { + } + + public void updateStyle (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_SIZE, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java new file mode 100644 index 000000000000..279256213a21 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontStyleMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +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 FontStyleMapper implements StyleMapper +{ + public FontStyleMapper () + { + } + + public void updateStyle (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_STYLE, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java new file mode 100644 index 000000000000..2f5043deb4c5 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontWeightMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +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 FontWeightMapper implements StyleMapper +{ + public FontWeightMapper () + { + } + + public void updateStyle (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_WEIGHT, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java new file mode 100644 index 000000000000..02d8c4b9a6e0 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java @@ -0,0 +1,57 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextAlignMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +package com.sun.star.report.pentaho.parser.stylemapper.fo; + +import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; +import org.jfree.layouting.input.style.keys.text.TextAlign; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; + +public class TextAlignMapper extends OneOfConstantsMapper +{ + public TextAlignMapper () + { + super(TextStyleKeys.TEXT_ALIGN); + addMapping("start", TextAlign.START); + addMapping("end", TextAlign.END); + addMapping("left", TextAlign.LEFT); + addMapping("center", TextAlign.CENTER); + addMapping("right", TextAlign.RIGHT); + addMapping("justify", TextAlign.JUSTIFY); + } + +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java new file mode 100644 index 000000000000..c131fdc78eeb --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java @@ -0,0 +1,72 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontFamilyGenericMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); + + final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); + if (value instanceof CSSValueList == false) + { + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + new CSSValueList(new CSSValue[]{ cssVal })); + } + else + { + CSSValueList list = (CSSValueList) value; + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + CSSValueList.insertLast(list, value)); + } + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java new file mode 100644 index 000000000000..0f959b960863 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java @@ -0,0 +1,72 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontFamilyMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:10 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); + + final CSSValue value = targetRule.getPropertyCSSValue(FontStyleKeys.FONT_FAMILY); + if (value instanceof CSSValueList == false) + { + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + new CSSValueList(new CSSValue[]{ cssVal })); + } + else + { + CSSValueList list = (CSSValueList) value; + targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, + CSSValueList.insertFirst(list, value)); + } + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java new file mode 100644 index 000000000000..362908afdb5a --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java @@ -0,0 +1,58 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontNameMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValue(FontStyleKeys.FONT_NAME, + new CSSStringValue(CSSStringType.STRING, attrValue)); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java new file mode 100644 index 000000000000..7a98313a9697 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java @@ -0,0 +1,52 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontPitchMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java new file mode 100644 index 000000000000..8b6623ae5f54 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java @@ -0,0 +1,56 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FontReliefMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java new file mode 100644 index 000000000000..714fe62e8dd8 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextEmphasizeMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, String attrName, String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString("font-emphasize", attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java new file mode 100644 index 000000000000..85c0e7d5f71b --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java @@ -0,0 +1,63 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextUnderlineColorMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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 (String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); + if (cv != null) + { + targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv); + } + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java new file mode 100644 index 000000000000..ded28f73eb8c --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java @@ -0,0 +1,61 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextUnderlineStyleMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java new file mode 100644 index 000000000000..a6506fabec8a --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWidthMapper.java @@ -0,0 +1,81 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextUnderlineWidthMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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); + return; + } + + // percent + // positive integer + // positive length + targetRule.setPropertyValueAsString(getStyleKey(), attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java new file mode 100644 index 000000000000..ccd87d775be5 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java @@ -0,0 +1,54 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextUnderlineWordMode.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java new file mode 100644 index 000000000000..7735aa881de5 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java @@ -0,0 +1,58 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: VerticalAlignMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + + +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.box.BoxStyleKeys; +import org.jfree.layouting.input.style.keys.text.TextStyleKeys; +import org.jfree.layouting.input.style.keys.line.LineStyleKeys; +import org.jfree.layouting.input.style.values.CSSConstant; +import org.jfree.layouting.input.style.values.CSSAutoValue; + +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()); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java new file mode 100644 index 000000000000..40a0ec5373cd --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java @@ -0,0 +1,61 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ColumnWidthMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +package com.sun.star.report.pentaho.parser.stylemapper.table; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; + +/** + * Creation-Date: 03.07.2006, 13:08:27 + * + * @author Thomas Morgner + */ +public class ColumnWidthMapper implements StyleMapper +{ + public ColumnWidthMapper() + { + } + + public void updateStyle(String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(BoxStyleKeys.WIDTH, attrValue); + } +} diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java new file mode 100644 index 000000000000..62760c6c4258 --- /dev/null +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java @@ -0,0 +1,61 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: RowHeightMapper.java,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2007-07-09 11:56:11 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2007 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * Copyright 2007 by Pentaho Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +package com.sun.star.report.pentaho.parser.stylemapper.table; + +import com.sun.star.report.pentaho.parser.StyleMapper; +import org.jfree.layouting.input.style.CSSDeclarationRule; +import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; + +/** + * Creation-Date: 03.07.2006, 13:08:27 + * + * @author Thomas Morgner + */ +public class RowHeightMapper implements StyleMapper +{ + public RowHeightMapper() + { + } + + public void updateStyle(String uri, + String attrName, + String attrValue, + CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, attrValue); + } +} |