Package org.jfree.report.structure

Examples of org.jfree.report.structure.Section


                final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
                final OfficeStyle style = deriveStyle(OfficeToken.TABLE_ROW, styleName);
                Element tableRowProperties = style.getTableRowProperties();
                if ( tableRowProperties == null )
                {
                    tableRowProperties = new Section();
                    tableRowProperties.setNamespace(OfficeNamespaces.STYLE_NS);
                    tableRowProperties.setType("table-row-properties");
                    tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor);
                    style.addNode(tableRowProperties);
                }
                else
                {
                    final Object oldValue = tableRowProperties.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
                    if ( oldValue == null || TRANSPARENT.equals(oldValue) )
                    {
                        tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor);
                    }
                }
                attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
            }
        }
        else if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs) )
        {
            columnCounter++;
            final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
            if ( styleName != null )
            {
                final OfficeStyle cellStyle = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_CELL, styleName);
                if ( cellStyle != null )
                {
                    final Section textProperties = (Section) cellStyle.getTextProperties();
                    if ( textProperties != null )
                    {
                        for ( String i : FOPROPS )
                        {
                            textProperties.setAttribute(OfficeNamespaces.FO_NS, i, null);
                        }
                        textProperties.setAttribute(OfficeNamespaces.TEXT_NS, "display", null);
                        for ( String i : STYLEPROPS )
                        {
                            textProperties.setAttribute(OfficeNamespaces.STYLE_NS, i, null);
                        }
                    }
                    final Section props = (Section) cellStyle.getTableCellProperties();
                    if ( props != null )
                    {
                        final Object raw = props.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR);
                        if ( TRANSPARENT.equals(raw) )
                        {
                            props.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, null);
                            // cellStyle.removeNode(props);
                        }
                    }
                }
                attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, styleName);
View Full Code Here


                {
                    columnWidth -= cba[i - 1].getBoundary();
                }
                columnWidth = columnWidth / CELL_WIDTH_FACTOR;
                final OfficeStyle style = deriveStyle(OfficeToken.TABLE_COLUMN, ("co" + i + "_"));
                final Section tableColumnProperties = new Section();
                tableColumnProperties.setType("table-column-properties");
                tableColumnProperties.setNamespace(style.getNamespace());
                tableColumnProperties.setAttribute(style.getNamespace(), "column-width", columnWidth + getUnitsOfMeasure(null));
                style.addNode(tableColumnProperties);

                final AttributeList myAttrList = new AttributeList();
                myAttrList.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName());
                xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, myAttrList, XmlWriterSupport.CLOSE);
View Full Code Here

    private String generateSectionStyle(final int columnCount)
    {
        final OfficeStyles automaticStyles = getStylesCollection().getAutomaticStyles();
        final String styleName = getAutoStyleNameGenerator().generateName("auto_section_style");

        final Section sectionProperties = new Section();
        sectionProperties.setNamespace(OfficeNamespaces.STYLE_NS);
        sectionProperties.setType("section-properties");
        sectionProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
        sectionProperties.setAttribute(OfficeNamespaces.TEXT_NS, "dont-balance-text-columns", OfficeToken.FALSE);
        sectionProperties.setAttribute(OfficeNamespaces.STYLE_NS, "editable", OfficeToken.FALSE);

        if (columnCount > 1)
        {
            final Section columns = new Section();
            columns.setNamespace(OfficeNamespaces.STYLE_NS);
            columns.setType("columns");
            columns.setAttribute(OfficeNamespaces.FO_NS, "column-count", String.valueOf(columnCount));
            columns.setAttribute(OfficeNamespaces.STYLE_NS, "column-gap", "0cm");
            sectionProperties.addNode(columns);

//    final Section columnSep = new Section();
//    columnSep.setNamespace(OfficeNamespaces.STYLE_NS);
//    columnSep.setType("column-sep");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "width", "0.035cm");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "color", "#000000");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "height", "100%");
//    columns.addNode(columnSep);

            for (int i = 0; i < columnCount; i++)
            {
                final Section column = new Section();
                column.setNamespace(OfficeNamespaces.STYLE_NS);
                column.setType("column");
                column.setAttribute(OfficeNamespaces.STYLE_NS, "rel-width", "1*");
                column.setAttribute(OfficeNamespaces.FO_NS, "start-indent", "0cm");
                column.setAttribute(OfficeNamespaces.FO_NS, "end-indent", "0cm");
                columns.addNode(column);
            }
        }

        final OfficeStyle style = new OfficeStyle();
View Full Code Here

    private static void performDataStyleProcessing(final OfficeStyle style,
            final OfficeStylesCollection stylesCollection,
            final OfficeStylesCollection predefCollection)
            throws ReportProcessingException
    {
        final Section derivedStyle = performDataStyleProcessing(style, stylesCollection, predefCollection, "data-style-name");
        if (derivedStyle != null)
        {
            try
            {
                final Section styleMap = (Section) derivedStyle.findFirstChild(OfficeNamespaces.STYLE_NS, "map");
                if (styleMap != null)
                {
                    performDataStyleProcessing(styleMap, stylesCollection, predefCollection, "apply-style-name");
                }
            }
View Full Code Here

    private String generateSectionStyle(final int columnCount)
    {
        final OfficeStyles automaticStyles = getStylesCollection().getAutomaticStyles();
        final String styleName = getAutoStyleNameGenerator().generateName("auto_section_style");

        final Section sectionProperties = new Section();
        sectionProperties.setNamespace(OfficeNamespaces.STYLE_NS);
        sectionProperties.setType("section-properties");
        sectionProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
        sectionProperties.setAttribute(OfficeNamespaces.TEXT_NS, "dont-balance-text-columns", OfficeToken.FALSE);
        sectionProperties.setAttribute(OfficeNamespaces.STYLE_NS, "editable", OfficeToken.FALSE);

        if (columnCount > 1)
        {
            final Section columns = new Section();
            columns.setNamespace(OfficeNamespaces.STYLE_NS);
            columns.setType("columns");
            columns.setAttribute(OfficeNamespaces.FO_NS, "column-count", String.valueOf(columnCount));
            columns.setAttribute(OfficeNamespaces.STYLE_NS, "column-gap", "0cm");
            sectionProperties.addNode(columns);

//    final Section columnSep = new Section();
//    columnSep.setNamespace(OfficeNamespaces.STYLE_NS);
//    columnSep.setType("column-sep");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "width", "0.035cm");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "color", "#000000");
//    columnSep.setAttribute(OfficeNamespaces.STYLE_NS, "height", "100%");
//    columns.addNode(columnSep);

            for (int i = 0; i < columnCount; i++)
            {
                final Section column = new Section();
                column.setNamespace(OfficeNamespaces.STYLE_NS);
                column.setType("column");
                column.setAttribute(OfficeNamespaces.STYLE_NS, "rel-width", "1*");
                column.setAttribute(OfficeNamespaces.FO_NS, "start-indent", "0cm");
                column.setAttribute(OfficeNamespaces.FO_NS, "end-indent", "0cm");
                columns.addNode(column);
            }
        }

        final OfficeStyle style = new OfficeStyle();
View Full Code Here

        else
        {
            variablesSectionStyle.setStyleName(TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITHOUT_KEEPWNEXT);
        }

        final Section paragraphProps = new Section();
        paragraphProps.setNamespace(OfficeNamespaces.STYLE_NS);
        paragraphProps.setType(PARAGRAPH_PROPERTIES);
        paragraphProps.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, "transparent");
        paragraphProps.setAttribute(OfficeNamespaces.FO_NS, "text-align", "start");
        paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_WITH_NEXT, ALWAYS);
        paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_TOGETHER, ALWAYS);
        paragraphProps.setAttribute(OfficeNamespaces.STYLE_NS, "vertical-align", "top");
        variablesSectionStyle.addNode(paragraphProps);

        final Section textProps = new Section();
        textProps.setNamespace(OfficeNamespaces.STYLE_NS);
        textProps.setType("text-properties");
        textProps.setAttribute(OfficeNamespaces.FO_NS, "font-variant", NORMAL);
        textProps.setAttribute(OfficeNamespaces.FO_NS, "text-transform", NONE);
        textProps.setAttribute(OfficeNamespaces.FO_NS, "color", "#ffffff");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-outline", OfficeToken.FALSE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", OfficeToken.FALSE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-style", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-line-through-mode", "continuous");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-position", "0% 100%");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-name", "Tahoma");
        textProps.setAttribute(OfficeNamespaces.FO_NS, "font-size", "1pt");
        textProps.setAttribute(OfficeNamespaces.FO_NS, "letter-spacing", NORMAL);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "letter-kerning", OfficeToken.FALSE);
        textProps.setAttribute(OfficeNamespaces.FO_NS, "font-style", NORMAL);
        textProps.setAttribute(OfficeNamespaces.FO_NS, "text-shadow", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-style", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-underline-mode", "continuous");
        textProps.setAttribute(OfficeNamespaces.FO_NS, "font-weight", NORMAL);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-rotation-angle", "0");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-emphasize", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-start-char", "");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-combine-end-char", "");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-blinking", OfficeToken.FALSE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-scale", "100%");
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "font-relief", NONE);
        textProps.setAttribute(OfficeNamespaces.STYLE_NS, "text-display", NONE);
        variablesSectionStyle.addNode(textProps);
        return variablesSectionStyle;
    }
View Full Code Here

                            // Lets set the 'keep-together' flag..

                            Element paragraphProps = style.getParagraphProperties();
                            if (paragraphProps == null)
                            {
                                paragraphProps = new Section();
                                paragraphProps.setNamespace(OfficeNamespaces.STYLE_NS);
                                paragraphProps.setType(PARAGRAPH_PROPERTIES);
                                style.addNode(paragraphProps);
                            }
                            paragraphProps.setAttribute(OfficeNamespaces.FO_NS, KEEP_TOGETHER, ALWAYS);
View Full Code Here

            final String type)
    {
        Element paragraphProps = style.findFirstChild(nameSpace, type);
        if (paragraphProps == null)
        {
            paragraphProps = new Section();
            paragraphProps.setNamespace(nameSpace);
            paragraphProps.setType(type);
            style.addNode(paragraphProps);
        }
        return paragraphProps;
View Full Code Here

    private final Section content;

    public FixedTextElement()
    {
        content = new Section();
        content.setVirtual(true);
    }
View Full Code Here

    private final Section otherNodes;

    public OfficeMasterStyles()
    {
        masterPages = new HashMap();
        otherNodes = new Section();
    }
View Full Code Here

TOP

Related Classes of org.jfree.report.structure.Section

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.