Package org.jfree.report.structure

Examples of org.jfree.report.structure.Section


    private TableReadHandler sectionTableReadHandler;
    private final Section section;

    public RootTableReadHandler()
    {
        section = new Section();
    }
View Full Code Here


    private ElementReadHandler reportReadHandler;
    private final Section body;

    public BodyReadHandler()
    {
        body = new Section();
    }
View Full Code Here

        if (groupHeader != null)
        {
            groupInstanceSection.addNode(groupHeader.getElement());
        }

        final Section groupBody = new Section();
        groupBody.setNamespace(JFreeReportInfo.REPORT_NAMESPACE);
        groupBody.setType("group-body");
        groupInstanceSection.addNode(groupBody);
        // XOR: Either the detail or the group section can be set ..
        if (detailSection != null)
        {
            groupBody.addNode(detailSection.getElement());
        }
        else if (childGroup != null)
        {
            groupBody.addNode(childGroup.getElement());
        }

        if (groupFooter != null)
        {
            groupInstanceSection.addNode(groupFooter.getElement());
View Full Code Here

                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());
                final String width = String.format("%f", columnWidth);
                tableColumnProperties.setAttribute(style.getNamespace(),
                        "column-width", width + getUnitsOfMeasure(null));
                style.addNode(tableColumnProperties);

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

  protected FlowController startData(final ReportTarget target,
                                     final FlowController fc)
      throws DataSourceException, ReportProcessingException,
      ReportDataFactoryException
  {
    final Section s = (Section) getElement();
    return LayoutControllerUtil.processFlowOperations
        (fc, s.getOperationBefore());
  }
View Full Code Here

      ReportDataFactoryException
  {
    FlowController fc = handleDefaultEndElement(target);

    // unwind the stack ..
    final Section s = (Section) getElement();
    fc = finishData(target, fc);

    if (s.isRepeat())
    {
      final FlowController cfc = tryRepeatingCommit(fc);
      if (cfc != null)
      {
        // Go back to the beginning ...
View Full Code Here

  protected FlowController finishData(final ReportTarget target,
                                      final FlowController fc)
      throws DataSourceException, ReportProcessingException
  {
    final Section s = (Section) getElement();
    return LayoutControllerUtil.processFlowOperations
        (fc, s.getOperationAfter());
  }
View Full Code Here

  public Node[] getNodes()
  {
    if (nodes == null)
    {
      final Section s = (Section) getElement();
      nodes = s.getNodeArray();
    }
    return nodes;
  }
View Full Code Here

   * @param namespace
   * @param tagName
   */
  public OutOfOrderSectionReadHandler()
  {
    outOfOrderSection = 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.