Package org.pentaho.reporting.engine.classic.core.layout.model

Examples of org.pentaho.reporting.engine.classic.core.layout.model.SectionRenderBox


  private SectionRenderBox createSectionBox(final int type, final BoxDefinition boxDefinition)
  {
    if (type == Renderer.TYPE_NORMALFLOW && sectionBoxes[type] != null)
    {
      final SectionRenderBox renderBox = sectionBoxes[type];
      sectionBoxes[type] = null;
      return renderBox;
    }

    return new SectionRenderBox
        (bandWithoutKeepTogetherStyle, new InstanceID(), boxDefinition, AutoLayoutBoxType.INSTANCE,
            ReportAttributeMap.EMPTY_MAP, null);
  }
View Full Code Here


    if (isIgnoreContent())
    {
      return;
    }

    final SectionRenderBox sectionBox;
    // todo: The group together should be cleanly inherited from the direct parent..
    if (type == Renderer.TYPE_WATERMARK)
    {
      pageBox.getFooterArea().clear();
      watermarkLayoutBuilder.startSection(pageBox.getWatermarkArea(), true);

      sectionBox = createSectionBox(type, watermarkBoxDefinition);
      sectionBox.setName("Watermark-Section");
      this.section = new Section(type, sectionBox);
    }
    else if (type == Renderer.TYPE_HEADER)
    {
      // when a header starts, we have to clear the page-footer too (to get rid of all the slotted bands).
      pageBox.getFooterArea().clear();
      headerLayoutBuilder.startSection(pageBox.getHeaderArea(), true);

      sectionBox = createSectionBox(type, BoxDefinition.EMPTY);
      sectionBox.setName("Header-" + type);
      this.section = new Section(type, sectionBox);
    }
    else if (type == Renderer.TYPE_FOOTER)
    {
      footerLayoutBuilder.startSection(pageBox.getFooterArea(), true);

      sectionBox = createSectionBox(type, BoxDefinition.EMPTY);
      sectionBox.setName("Footer-" + type);
      this.section = new Section(type, sectionBox);
    }
    else
    {
      normalFlowLayoutBuilder.startSection(pageBox, false);

      sectionBox = createSectionBox(TYPE_NORMALFLOW, BoxDefinition.EMPTY);
      sectionBox.setName("Section-" + type);
      this.section = new Section(type, sectionBox);
    }

  }
View Full Code Here

      return EMPTY_ARRAY;
    }

    final Section section = this.section;
    this.section = null;
    final SectionRenderBox sectionBox = section.getSectionBox();
    sectionBox.close();

    final int sectionType = section.getType();
    switch (sectionType)
    {
      case Renderer.TYPE_NORMALFLOW:
      {
        final RenderNode firstChild = sectionBox.getFirstChild();
        if (firstChild == null)
        {
          // the whole section is empty; therefore we can ignore it.
          sectionBox.makeReusable();
          sectionBoxes[sectionType] = sectionBox;
          return normalFlowLayoutBuilder.endSection(getPageBox(), sectionBox);
        }

        final int type = firstChild.getNodeType();
        if (sectionBox.getLastChild() == firstChild &&
            type == LayoutNodeTypes.TYPE_BOX_INLINE_PROGRESS_MARKER ||
            type == LayoutNodeTypes.TYPE_BOX_PROGRESS_MARKER)
        {
          if (mergeSection(sectionBox))
          {
            sectionBox.makeReusable();
            sectionBoxes[sectionType] = sectionBox;
            return normalFlowLayoutBuilder.endSection(getPageBox(), sectionBox);
          }
        }

        addBox(sectionBox);
        markDirty();
        return normalFlowLayoutBuilder.endSection(getPageBox(), sectionBox);
      }
      case Renderer.TYPE_FOOTER:
      {
        final BlockRenderBox footerArea = pageBox.getFooterArea();
        if (sectionBox.getFirstChild() == sectionBox.getLastChild() &&
            isEmptyOrMarker(footerArea.getFirstChild()) &&
            isEmptyOrMarker(sectionBox.getFirstChild()))
        {
          // both boxes are empty, so we can ignore it ...
          return footerLayoutBuilder.endSection(footerArea, sectionBox);
        }

        markDirty();
        return footerLayoutBuilder.endSection(footerArea, sectionBox);
      }
      case Renderer.TYPE_HEADER:
      {
        final BlockRenderBox headerArea = pageBox.getHeaderArea();
        if (sectionBox.getFirstChild() == sectionBox.getLastChild() &&
            isEmptyOrMarker(headerArea.getFirstChild()) &&
            isEmptyOrMarker(sectionBox.getFirstChild()))
        {
          // both boxes are empty, so we can ignore it ...
          return headerLayoutBuilder.endSection(headerArea, sectionBox);
        }
        markDirty();
        return headerLayoutBuilder.endSection(headerArea, sectionBox);
      }
      case Renderer.TYPE_WATERMARK:
      {
        // ignore for now.
        final WatermarkAreaBox watermarkArea = pageBox.getWatermarkArea();
        if (sectionBox.getFirstChild() == sectionBox.getLastChild() &&
            isEmptyOrMarker(watermarkArea.getFirstChild()) &&
            isEmptyOrMarker(sectionBox.getFirstChild()))
        {
          // both boxes are empty, so we can ignore it ...
          return watermarkLayoutBuilder.endSection(watermarkArea, sectionBox);
        }
        markDirty();
View Full Code Here

    final Resource directly = mgr.createDirectly(file, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
//    ModelPrinter.print(logicalPageBox);
    SectionRenderBox srb = (SectionRenderBox) logicalPageBox.getFooterArea().getFirstChild();
    assertTrue(srb.getFirstChild() instanceof ProgressMarkerRenderBox);
  }
View Full Code Here

    }

    public RenderBox produceSectionBox(final String layoutType, final ReportStateKey stateKey)
    {
      final StyleSheet styleSheet = new SectionKeepTogetherStyleSheet(false);
      return new SectionRenderBox(styleSheet, new InstanceID(), watermarkBoxDefinition, AutoLayoutBoxType.INSTANCE,
          ReportAttributeMap.emptyMap(), stateKey);
    }
View Full Code Here

  public RenderBox produceSectionBox(final String layoutType, final ReportStateKey stateKey)
  {
    if (strictCompatibilityMode)
    {
      final BoxDefinition boxDefinition = BoxDefinition.EMPTY;
      return new SectionRenderBox(bandWithoutKeepTogetherStyle, new InstanceID(), boxDefinition, AutoLayoutBoxType.INSTANCE,
          ReportAttributeMap.emptyMap(), stateKey);
    }

    final RenderBox renderBox = createBox(layoutType, stateKey,
        SECTION_DEFAULT_STYLE, AutoLayoutBoxType.INSTANCE, ReportAttributeMap.emptyMap(), new InstanceID());
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.model.SectionRenderBox

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.