Package org.jfree.report.structure

Examples of org.jfree.report.structure.Element


    {
        final Node[] columnDefs = columns.getNodeArray();
        int columnCounter = 0;
        for (Node columnDef : columnDefs)
        {
            final Element column = (Element) columnDef;

            if (!ObjectUtilities.equal(column.getNamespace(), OfficeNamespaces.TABLE_NS) || !ObjectUtilities.equal(column.getType(), OfficeToken.TABLE_COLUMN))
            {
                continue;
            }
            if (columnCounter >= columnPos)
            {
                final String colStyle = (String) column.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
                context.setColStyle(columnCounter - columnPos, colStyle);
            }

            columnCounter += 1;
View Full Code Here


    {
        final Node[] rows = table.getNodeArray();
        int rowCounter = 0;
        for (Node row1 : rows)
        {
            final Element row = (Element) row1;

            if (!ObjectUtilities.equal(row.getNamespace(), OfficeNamespaces.TABLE_NS) || !ObjectUtilities.equal(row.getType(), OfficeToken.TABLE_ROW))
            {
                continue;
            }
            if (rowCounter >= rowPos)
            {
                final String rowStyle = (String) row.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
                context.setRowStyle(rowCounter - rowPos, rowStyle);
            }

            rowCounter += 1;
View Full Code Here

        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Element)
            {
                final Element child = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) && OfficeToken.TABLE_ROW.equals(child.getType()))
                {
                    rowCount += 1;
                }
            }
        }
View Full Code Here

            // no processing necessary, as the header or footer contain no variables at all ..
            return vlc;
        }


        final Element node = (Element) getNode();
        final AttributeMap vdSection = node.getAttributeMap();
        target.startElement(vdSection);

        final FormattedTextElement[] variables = collection.getVariables();
        for (int i = 0; i < variables.length; i++)
        {
View Full Code Here

                {
                    target.processContent(df);
                }
                else //@see http://qa.openoffice.org/issues/show_bug.cgi?id=108954
                {
                    Element cell = getParentTableCell();
                    if (cell != null && "string".equals(cell.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE)))
                    {
                        target.processContent(df);
                    }
                }
            }
View Full Code Here

        return null;
    }

    private String computeValueStyle()
    {
        final Element tce = getParentTableCell();
        if (tce == null)
        {
            return null;
        }

        final String cellStyleName = (String) tce.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
        if (cellStyleName == null)
        {
            return null;
        }
        final OfficeDocument document = getDocument();
View Full Code Here

        return (String) style.getAttribute(OfficeNamespaces.STYLE_NS, "data-style-name");
    }

    private String computeValueType()
    {
        final Element tce = getParentTableCell();
        if (tce == null)
        {
            // NO particular format means: Fallback to string and hope and pray ..
            throw new IllegalStateException("A formatted text element must be a child of a Table-Cell.");
        }

        final String type = (String) tce.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE);
        if (type == null)
        {
            LOGGER.error("The Table-Cell does not have a office:value attribute defined. Your content will be messed up.");
            return "string";
        }
View Full Code Here

                parent = parent.getParent();
            }
            else
            {
                final SectionLayoutController slc = (SectionLayoutController) parent;
                final Element element = slc.getElement();
                if (element instanceof OfficeGroupSection)
                {
                    // This is a header or footer. So we take the next group instead.
                    skipNext = true;
                    parent = parent.getParent();
View Full Code Here

            // Lets make sure the color of the table is ok ..
            if (tableBackgroundColor != null)
            {
                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());
            }
        }
View Full Code Here

            {
                // Now this is very bad. It means that there is no style defined with the given name.
                return;
            }

            final Element tableColumnProperties = style.getTableColumnProperties();
            String widthStr = (String) tableColumnProperties.getAttribute("column-width");
            widthStr = widthStr.substring(0, widthStr.indexOf(getUnitsOfMeasure(widthStr)));
            final float val = Float.parseFloat(widthStr) * CELL_WIDTH_FACTOR;
            addColumnWidthToRowBoundaryMarker((long) val);
            ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker());
            final List columnBoundaryList_ = getColumnBoundaryList();
View Full Code Here

TOP

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

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.