Package org.jfree.layouting.renderer.model.page

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


      }
      finishBlockBox(box);
    }
    else if (node instanceof LogicalPageBox)
    {
      final LogicalPageBox box = (LogicalPageBox) node;
      if (startBlockBox(box))
      {
        startProcessing(box.getHeaderArea());
        processBoxChilds(box);
        startProcessing(box.getFooterArea());
      }
      finishBlockBox(box);
    }
    else if (node instanceof BlockRenderBox)
    {
View Full Code Here

    final PageGrid pageGrid =
        this.pageContext.createPageGrid(this.layoutProcess.getOutputMetaData());

    // initialize the logical page. The logical page needs the page grid,
    // as this contains the hints for the physical page sizes.
    logicalPageBox = new LogicalPageBox(pageGrid);
    logicalPageBox.setPageContext(this.pageContext.getPageContext());


  }
View Full Code Here

  protected void processBlockLevelChild (final RenderNode node)
  {
    if (node instanceof LogicalPageBox)
    {
      final LogicalPageBox box = (LogicalPageBox) node;
      if (startBlockLevelBox(box))
      {
        startProcessing(box.getHeaderArea());
        processBoxChilds(box);
        startProcessing(box.getFooterArea());
      }
      finishBlockLevelBox(box);
    }
    else if (node instanceof NormalFlowRenderBox)
    {
      final NormalFlowRenderBox box = (NormalFlowRenderBox) node;
      final NormalFlowRenderBox[] flows = box.getFlows();
      for (int i = 0; i < flows.length; i++)
      {
        final NormalFlowRenderBox flow = flows[i];
        processFlow(flow);
      }
View Full Code Here

   * @throws NormalizationException
   */
  protected void validateOutput() throws NormalizationException
  {
    final OutputProcessor outputProcessor = getLayoutProcess().getOutputProcessor();
    final LogicalPageBox logicalPageBox = getLogicalPageBox();

    if (outputProcessor.getMetaData().isIterative() == false)
    {
      if (logicalPageBox.isOpen())
      {
        return;
      }
    }

    if (validateModelStep.isLayoutable(logicalPageBox) == false)
    {
      return;
    }

    tableValidationStep.validate(logicalPageBox);

    updateTokensStep.compute
        (logicalPageBox, getLayoutProcess(), getPageContext());
    staticPropertiesStep.compute(logicalPageBox);
    marginsStep.compute(logicalPageBox);
    paragraphLinebreakStep.compute(logicalPageBox);

    icmMetricsStep.compute(logicalPageBox);
    tableICMMetricsStep.compute(logicalPageBox);

    minorAxisLayoutStep.compute(logicalPageBox);
    majorAxisLayoutStep.compute(logicalPageBox);
    tableRowHeightStep.compute(logicalPageBox);
    breakabilityStep.compute(logicalPageBox);

    paginationStep.performPagebreak(logicalPageBox);

    // 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)
    outputProcessor.processContent(logicalPageBox);

    // Now fire the pagebreak. This goes through all layers and informs all
    // components, that a pagebreak has been encountered and possibly a
    // new page has been set. It does not save the state or perform other
    // expensive operations. However, it updates the 'isPagebreakEncountered'
    // flag, which will be active until the input-feed received a new event.
    if (logicalPageBox.isOpen())
    {
      firePagebreak();
      cleanBoxesStep.compute(logicalPageBox);
    }
    else
View Full Code Here

    this(layoutProcess, true);
  }

  protected void validateOutput() throws NormalizationException
  {
    final LogicalPageBox logicalPageBox = getLogicalPageBox();
    if (validateModelStep.isLayoutable(logicalPageBox) == false)
    {
//      final RenderNode nodeById = logicalPageBox.findNodeById(validateModelStep.getLayoutFailureNodeId());
//      Log.debug ("Validation impossible: Reason-id: " +
//          validateModelStep.getLayoutFailureResolution() +
//          " on node " +
//          nodeById);

      setLayoutFailureReason(validateModelStep.getLayoutFailureResolution(),
          validateModelStep.getLayoutFailureNodeId());
      return;
    }

    tableValidationStep.validate(logicalPageBox);
    updateTokensStep.compute
        (logicalPageBox, getLayoutProcess(), getPageContext());
    staticPropertiesStep.compute(logicalPageBox);
    marginsStep.compute(logicalPageBox);
    paragraphLinebreakStep.compute(logicalPageBox);
    icmMetricsStep.compute(logicalPageBox);

    boolean repeat = true;
    while (repeat)
    {
      tableICMMetricsStep.compute(logicalPageBox);

      minorAxisLayoutStep.compute(logicalPageBox);
      majorAxisLayoutStep.compute(logicalPageBox);
      tableRowHeightStep.compute(logicalPageBox);
      breakabilityStep.compute(logicalPageBox);

      if (paginationStep.performPagebreak(logicalPageBox) ||
          logicalPageBox.isOpen() == false)
      {
        // Note: This logic might fail if the last commit causes more than one pagebreak.
        // We may have to find a 'content-based' indicator when to shut-down the system.

        // 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 =
            getLayoutProcess().getOutputProcessor();
        final long nextOffset = paginationStep.getNextOffset();
        final long pageOffset = logicalPageBox.getPageOffset();
        final LogicalPageBox box = fillPhysicalPagesStep.compute
            (logicalPageBox, pageOffset, nextOffset);
        outputProcessor.processContent(box);

        // Now fire the pagebreak. This goes through all layers and informs all
        // components, that a pagebreak has been encountered and possibly a
View Full Code Here

    this(layoutProcess, true);
  }

  protected void validateOutput() throws NormalizationException
  {
    final LogicalPageBox logicalPageBox = getLogicalPageBox();
    if (validateModelStep.isLayoutable(logicalPageBox) == false)
    {
//      final RenderNode nodeById = logicalPageBox.findNodeById(validateModelStep.getLayoutFailureNodeId());
//      Log.debug ("Validation impossible: Reason-id: " +
//          validateModelStep.getLayoutFailureResolution() +
//          " on node " +
//          nodeById);

      setLayoutFailureReason(validateModelStep.getLayoutFailureResolution(),
          validateModelStep.getLayoutFailureNodeId());
      return;
    }

    tableValidationStep.validate(logicalPageBox);
    updateTokensStep.compute
        (logicalPageBox, getLayoutProcess(), getPageContext());
    staticPropertiesStep.compute(logicalPageBox);
    marginsStep.compute(logicalPageBox);
    paragraphLinebreakStep.compute(logicalPageBox);
    icmMetricsStep.compute(logicalPageBox);

    boolean repeat = true;
    while (repeat)
    {
      tableICMMetricsStep.compute(logicalPageBox);

      minorAxisLayoutStep.compute(logicalPageBox);
      majorAxisLayoutStep.compute(logicalPageBox);
      tableRowHeightStep.compute(logicalPageBox);
      breakabilityStep.compute(logicalPageBox);

      if (paginationStep.performPagebreak(logicalPageBox) ||
          logicalPageBox.isOpen() == false)
      {
        // Note: This logic might fail if the last commit causes more than one pagebreak.
        // We may have to find a 'content-based' indicator when to shut-down the system.

        // 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 =
            getLayoutProcess().getOutputProcessor();
        final long nextOffset = paginationStep.getNextOffset();
        final long pageOffset = logicalPageBox.getPageOffset();
        final LogicalPageBox box = fillPhysicalPagesStep.compute
            (logicalPageBox, pageOffset, nextOffset);
        outputProcessor.processContent(box);

        // Now fire the pagebreak. This goes through all layers and informs all
        // components, that a pagebreak has been encountered and possibly a
View Full Code Here

   * @throws NormalizationException
   */
  protected void validateOutput() throws NormalizationException
  {
    final OutputProcessor outputProcessor = getLayoutProcess().getOutputProcessor();
    final LogicalPageBox logicalPageBox = getLogicalPageBox();

    if (outputProcessor.getMetaData().isIterative() == false)
    {
      if (logicalPageBox.isOpen())
      {
        return;
      }
    }

    if (validateModelStep.isLayoutable(logicalPageBox) == false)
    {
      return;
    }

    tableValidationStep.validate(logicalPageBox);

    updateTokensStep.compute
        (logicalPageBox, getLayoutProcess(), getPageContext());
    staticPropertiesStep.compute(logicalPageBox);
    marginsStep.compute(logicalPageBox);
    paragraphLinebreakStep.compute(logicalPageBox);

    icmMetricsStep.compute(logicalPageBox);
    tableICMMetricsStep.compute(logicalPageBox);

    minorAxisLayoutStep.compute(logicalPageBox);
    majorAxisLayoutStep.compute(logicalPageBox);
    tableRowHeightStep.compute(logicalPageBox);
    breakabilityStep.compute(logicalPageBox);

    paginationStep.performPagebreak(logicalPageBox);

    // 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)
    outputProcessor.processContent(logicalPageBox);

    // Now fire the pagebreak. This goes through all layers and informs all
    // components, that a pagebreak has been encountered and possibly a
    // new page has been set. It does not save the state or perform other
    // expensive operations. However, it updates the 'isPagebreakEncountered'
    // flag, which will be active until the input-feed received a new event.
    if (logicalPageBox.isOpen())
    {
      Log.debug ("PAGEBREAK ENCOUNTERED");
      firePagebreak();
      cleanBoxesStep.compute(logicalPageBox);
    }
View Full Code Here

    final PageGrid pageGrid =
        this.pageContext.createPageGrid(this.layoutProcess.getOutputMetaData());

    // initialize the logical page. The logical page needs the page grid,
    // as this contains the hints for the physical page sizes.
    logicalPageBox = new LogicalPageBox(pageGrid);
    logicalPageBox.setPageContext(this.pageContext.getPageContext());


  }
View Full Code Here

  protected void processBlockLevelChild (final RenderNode node)
  {
    if (node instanceof LogicalPageBox)
    {
      final LogicalPageBox box = (LogicalPageBox) node;
      if (startBlockLevelBox(box))
      {
        startProcessing(box.getHeaderArea());
        processBoxChilds(box);
        startProcessing(box.getFooterArea());
      }
      finishBlockLevelBox(box);
    }
    else if (node instanceof NormalFlowRenderBox)
    {
      final NormalFlowRenderBox box = (NormalFlowRenderBox) node;
      final NormalFlowRenderBox[] flows = box.getFlows();
      for (int i = 0; i < flows.length; i++)
      {
        final NormalFlowRenderBox flow = flows[i];
        processFlow(flow);
      }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.model.page.LogicalPageBox

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.