Examples of LogicalPageBox


Examples of org.jfree.layouting.renderer.model.page.LogicalPageBox

    // Copy and relocate, then prune. (I whished we could prune first, but
    // this does not work.)
    //
    // For the sake of efficiency, we do *not* create private copies for each
    // phyiscal page. This would be an total overkill.
    final LogicalPageBox derived = (LogicalPageBox) pagebox.derive(true);

    // first, shift the normal-flow content downwards.
    // The start of the logical pagebox might be in the negative range now
    // The header-size has already been taken into account by the pagination
    // step.
    final BoxShifter boxShifter = new BoxShifter();
    boxShifter.shiftBoxUnchecked(derived, -pageStart + contentStart);

    // now remove all the content that will not be visible at all ..
    if (startBlockLevelBox(derived))
    {
      // not processing the header and footer area: they are 'out-of-context' bands
      processBoxChilds(derived);
    }
    finishBlockLevelBox(derived);

    // Then add the header at the top - it starts at (0,0) and thus it is
    // ok to leave it unshifted.

    // finally, move the footer at the bottom (to the page's bottom, please!)
    final PageAreaRenderBox footerArea = derived.getFooterArea();
    final long footerPosition = pagebox.getPageHeight() -
        (footerArea.getY() + footerArea.getHeight());
    final long footerShift = footerPosition - footerArea.getY();
    boxShifter.shiftBoxUnchecked(footerArea, footerShift);

View Full Code Here

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

                                      final boolean performOutput)
      throws ContentProcessingException
  {
    final OutputProcessor outputProcessor = getOutputProcessor();
    // next: perform pagination.
    final LogicalPageBox _pageBox = getPageBox();

    final LogicalPageBox clone = (LogicalPageBox) _pageBox.derive(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(clone);

    debugPrint(clone);
    setPagebreaks(getPagebreaks() + 1);
    clone.setAllVerticalBreaks(pageBreak.getAllBreaks());

    flowCount += 1;

    // A new page has been started. Recover the page-grid, then restart
    // everything from scratch. (We have to recompute, as the pages may
    // be different now, due to changed margins or page definitions)
    final long nextOffset = clone.computePageEnd();
    clone.setPageEnd(nextOffset);
    final long pageOffset = clone.getPageOffset();

    if (outputProcessor.isNeedAlignedPage())
    {
      final LogicalPageBox box = fillPhysicalPagesStep.compute(clone, pageOffset, nextOffset);
      logger.debug("Processing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);

      outputProcessor.processContent(box);
    }
    else
View Full Code Here

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

  {
  }

  protected boolean isPageFinished()
  {
    final LogicalPageBox pageBox = getPageBox();
//    final long sizeBeforePagination = pageBox.getHeight();
//    final LogicalPageBox clone = (LogicalPageBox) pageBox.derive(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(pageBox);
    if (pageBreak.isOverflow() || pageBox.isOpen() == false)
    {
      setLastStateKey(pageBreak.getLastVisibleState());
      return true;
    }
    return false;
View Full Code Here

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

  protected boolean performPagination(final LayoutPagebreakHandler layoutPagebreakHandler,
                                      final boolean performOutput)
      throws ContentProcessingException
  {
    // next: perform pagination.
    final LogicalPageBox pageBox = getPageBox();

    //    final long sizeBeforePagination = pageBox.getHeight();
    //    final LogicalPageBox clone = (LogicalPageBox) pageBox.derive(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(pageBox);
    if (pageBreak.isOverflow() || pageBox.isOpen() == false)
    {
//      final long sizeAfterPagination = pageBox.getHeight();
      setLastStateKey(pageBreak.getLastVisibleState());
      setPagebreaks(getPagebreaks() + 1);
      pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());

      pageCount += 1;
//      DebugLog.log("1: **** Start Printing Page: " + pageCount);
      debugPrint(pageBox);

      // A new page has been started. Recover the page-grid, then restart
      // everything from scratch. (We have to recompute, as the pages may
      // be different now, due to changed margins or page definitions)
      final OutputProcessor outputProcessor = getOutputProcessor();
      final long nextOffset = pageBreak.getLastPosition();
      final long pageOffset = pageBox.getPageOffset();

      if (performOutput)
      {
        if (outputProcessor.isNeedAlignedPage())
        {
          final LogicalPageBox box = fillPhysicalPagesStep.compute(pageBox, pageOffset, nextOffset);
          outputProcessor.processContent(box);
          // DebugLog.log("Processing contents for Page " + pageCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
        }
        else
        {
View Full Code Here

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

  }

  public boolean isCurrentPageEmpty()
  {
    // todo: Invent a test that checks whether the page is currently empty.
    final LogicalPageBox logicalPageBox = getPageBox();
    if (logicalPageBox == null)
    {
      throw new IllegalStateException("LogicalPageBox being null? You messed it up again!");
    }

    final PageBreakPositionList breakPositionList = logicalPageBox.getAllVerticalBreaks();
    final long masterBreak = breakPositionList.getLastMasterBreak();
    final boolean nextPageContainsContent = (logicalPageBox.getHeight() > masterBreak);
    return nextPageContainsContent == false;
  }
View Full Code Here

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

      // page cannot have borders ...
      final int type = box.getNodeType();
      if ((type & LayoutNodeTypes.MASK_BOX_PAGEAREA) == LayoutNodeTypes.MASK_BOX_PAGEAREA)
      {
        final PageAreaBox pageAreaBox = (PageAreaBox) box;
        final LogicalPageBox pageBox = pageAreaBox.getLogicalPage();
        if (pageBox == null)
        {
          return 0;
        }
        return pageBox.getPageWidth();
      }
      if ((type & LayoutNodeTypes.TYPE_BOX_LOGICALPAGE) == LayoutNodeTypes.TYPE_BOX_LOGICALPAGE)
      {
        final LogicalPageBox logicalPage = (LogicalPageBox) box;
        return logicalPage.getPageWidth();
      }
      return 0;
    }

    // A row or inline-box never establishes a context on its own; it always transfers the parent's block-render context.
View Full Code Here

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

  private boolean processBox(final RenderBox parent)
  {
    boolean needDeepDive = false;
    if (parent.getNodeType() == LayoutNodeTypes.TYPE_BOX_LOGICALPAGE)
    {
      final LogicalPageBox lb = (LogicalPageBox) parent;
      if (processBoxRollback(lb.getWatermarkArea()))
      {
        needDeepDive = true;
      }
      if (processBoxRollback(lb.getHeaderArea()))
      {
        needDeepDive = true;
      }
      if (processBoxRollback(lb.getFooterArea()))
      {
        needDeepDive = true;
      }
    }
View Full Code Here

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

    // Copy and relocate, then prune. (I whished we could prune first, but
    // this does not work.)
    //
    // For the sake of efficiency, we do *not* create private copies for each
    // physical page. This would be an total overkill.
    final LogicalPageBox derived = (LogicalPageBox) pagebox.derive(true);

    // first, shift the normal-flow content downwards.
    // The start of the logical pagebox might be in the negative range now
    // The header-size has already been taken into account by the pagination
    // step.
    BoxShifter.shiftBoxUnchecked(derived, -pageStart + contentStart);

    // now remove all the content that will not be visible at all ..
    // not processing the header and footer area: they are 'out-of-context' bands
    processBoxChilds(derived);

    // Then add the header at the top - it starts at (0,0) and thus it is
    // ok to leave it unshifted.

    // finally, move the footer at the bottom (to the page's bottom, please!)
    final RenderBox footerArea = derived.getFooterArea();
    final long footerPosition = pagebox.getPageHeight() -
        (footerArea.getY() + footerArea.getHeight());
    final long footerShift = footerPosition - footerArea.getY();
    BoxShifter.shiftBoxUnchecked(footerArea, footerShift);

    // the renderer is responsible for painting the page-header and footer ..

    derived.setPageOffset(0);
    derived.setPageEnd(contentEnd);
    return derived;
  }
View Full Code Here

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

          }
          finishBlockBox(box);
        }
        else if (nodeType == LayoutNodeTypes.TYPE_BOX_LOGICALPAGE)
        {
          final LogicalPageBox box = (LogicalPageBox) node;
          if (startBlockBox(box))
          {
            startProcessing(box.getWatermarkArea());
            startProcessing(box.getHeaderArea());
            processBoxChilds(box);
            startProcessing(box.getFooterArea());
          }
          finishBlockBox(box);
        }
        else
        {
View Full Code Here

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

    final RenderBox parent = node.getParent();
    if (parent == null)
    {
      if (node.getNodeType() == LayoutNodeTypes.TYPE_BOX_WATERMARK)
      {
        final LogicalPageBox box = node.getLogicalPage();
        if (box != null)
        {
          return box.getPageHeight();
        }
      }
      return 0;
    }
    return parent.getCachedHeight();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.