Package org.jfree.report.structure

Examples of org.jfree.report.structure.Element


                        final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
                        final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
                        if (clipWidth > 0 && clipHeight > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(' ');
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(')');
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                        }
                        else if (clipWidth > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(0cm ");
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(" 0cm ");
                            buffer.append(clipWidth / 2);
                            buffer.append(imageAreaWidthVal.getType().getType());
                            buffer.append(')');
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                            imageAreaHeightVal = normalizedImageHeight;
                        }
                        else if (clipHeight > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
                            buffer.append("rect(");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(" 0cm ");
                            buffer.append(clipHeight / 2);
                            buffer.append(imageAreaHeightVal.getType().getType());
                            buffer.append(" 0cm)");
                            graphProperties.setAttribute(OfficeNamespaces.FO_NS, "clip", buffer.toString());

                            styleName = imageStyle.getStyleName();
                            getStylesCollection().getAutomaticStyles().addStyle(imageStyle);
                            imageAreaWidthVal = normalizedImageWidth;
                        }
View Full Code Here


    {
        final OfficeStylesCollection contentStyles = getContentStylesCollection();
        final OfficeStyle style = contentStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (style != null)
        {
            final Element element = style.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }

            final String styleParent = style.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
        final OfficeStyle globalStyle = globalStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (globalStyle != null)
        {
            final Element element = globalStyle.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
            final String styleParent = globalStyle.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyle predefStyle = predefStyles.getStyle(OfficeToken.TABLE_ROW, rowStyle);
        if (predefStyle != null)
        {
            final Element element = predefStyle.getTableRowProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "row-height");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
View Full Code Here

    {
        final OfficeStylesCollection contentStyles = getContentStylesCollection();
        final OfficeStyle style = contentStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
        if (style != null)
        {
            final Element element = style.getTableColumnProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
                if (height != null)
                {
                    return parseLength(height);
                }
            }

            final String styleParent = style.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection globalStyles = getGlobalStylesCollection();
        final OfficeStyle globalStyle = globalStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
        if (globalStyle != null)
        {
            final Element element = globalStyle.getTableColumnProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
            final String styleParent = globalStyle.getStyleParent();
            if (styleParent != null)
            {
                return computeRowHeight(styleParent);
            }
        }

        final OfficeStylesCollection predefStyles = getPredefinedStylesCollection();
        final OfficeStyle predefStyle = predefStyles.getStyle(OfficeToken.TABLE_COLUMN, colStyle);
        if (predefStyle != null)
        {
            final Element element = predefStyle.getTableColumnProperties();
            if (element != null)
            {
                final String height = (String) element.getAttribute(OfficeNamespaces.STYLE_NS, "column-width");
                if (height != null)
                {
                    return parseLength(height);
                }
            }
View Full Code Here

    protected Element produceFirstChild(final Section style,
            final String nameSpace,
            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

        for (int i = 0; i < nodeArray.length; i++)
        {
            final Node node = nodeArray[i];
            if (node instanceof Element)
            {
                final Element element = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table".equals(element.getType()))
                {
                    tables.add(element);
                }
            }
        }
View Full Code Here

     * @throws org.xml.sax.SAXException if there is a parsing error.
     */
    protected void startParsing(final Attributes attrs) throws SAXException
    {
        super.startParsing(attrs);
        final Element element = getElement();
        if (copyType)
        {
            copyElementType(element);
        }
        copyAttributes(attrs, element);
View Full Code Here

     * @param attrs the attributes.
     * @throws org.xml.sax.SAXException if there is a parsing error.
     */
    protected void startParsing(final Attributes attrs) throws SAXException
    {
        final Element element = getElement();
        copyElementType(element);
        copyAttributes(attrs, element);
    }
View Full Code Here

            if (cellController == null)
            {
                LOGGER.warn("Image is not contained in a table. Unable to calculate the image-size.");
                return null;
            }
            final Element tableCell = (Element) cellController.getNode();
            final int rowSpan = TextUtilities.parseInt((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-rows-spanned"), 1);
            final int colSpan = TextUtilities.parseInt((String) tableCell.getAttribute(OfficeNamespaces.TABLE_NS, "number-columns-spanned"), 1);
            if (rowSpan < 1 || colSpan < 1)
            {
                LOGGER.warn("Rowspan or colspan for image-size calculation was invalid.");
                return null;
            }
View Full Code Here

        {
            if (!(node instanceof Element))
            {
                continue;
            }
            final Element child = (Element) node;
            /*
            if (! OfficeToken.COVERED_TABLE_CELL.equals(child.getType()) &&
            (ObjectUtilities.equal(child.getNamespace(), namespace) == false ||
            ObjectUtilities.equal(child.getType(), type) == false))
             */
            if (!ObjectUtilities.equal(child.getNamespace(), namespace) || (!ObjectUtilities.equal(child.getType(), type) && (secondType == null || !ObjectUtilities.equal(child.getType(), secondType))))
            {
                continue;
            }

            if (node == tableCell)
View Full Code Here

        while (parent != null)
        {
            final Object node = parent.getNode();
            if (node instanceof Element)
            {
                final Element element = (Element) node;
                if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table-cell".equals(element.getType()))
                {
                    return parent;
                }
            }
            parent = parent.getParent();
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.