Examples of PageBreakPositions


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

    // If you've come this far, this means, that your box has a fixed position defined.
    final long boxY = box.getY();
    final long shiftedBoxPosition = boxY + shift;
    final long fixedPositionResolved = fixedPositionLength.resolve(paginationTableState.getPageHeight(), 0);
    final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
    final long fixedPositionInFlow = breakUtility.computeFixedPositionInFlow(shiftedBoxPosition, fixedPositionResolved);
    if (fixedPositionInFlow < shiftedBoxPosition)
    {
      // ... but the fixed position is invalid, so treat it as non-defined.
      return handleAutomaticPagebreak(box, shiftState);
    }

    // The computed break seems to be valid.
    // Compute what happens if the whole box can fit on the current page.
    // We have an opportunity to optimize our processing by skipping all content if there are no
    // manual pagebreaks defined on one of the childs.
    if (breakUtility.isCrossingPagebreakWithFixedPosition
        (shiftedBoxPosition, box.getHeight(), fixedPositionResolved) == false)
    {
      return handleFixedPositionWithoutBreakOnBox(box, shift, fixedPositionInFlow);
    }
View Full Code Here

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

  private boolean handleAutomaticPagebreak(final RenderBox box,
                                           final PaginationShiftState boxContext)
  {
    final long shift = boxContext.getShiftForNextChild();
    final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
    final long boxHeightAndWidowArea = Math.max
        (box.getHeight(), PaginationStepLib.getWidowConstraint(box, boxContext, paginationTableState));
    if (breakUtility.isCrossingPagebreak(box.getY(), boxHeightAndWidowArea, shift) == false)
    {
      // The whole box fits on the current page. No need to do anything fancy.
      final RenderBox.BreakIndicator breakIndicator = box.getManualBreakIndicator();
      if (breakIndicator == RenderBox.BreakIndicator.INDIRECT_MANUAL_BREAK ||
          box.getRestrictFinishedClearOut() == RenderBox.RestrictFinishClearOut.RESTRICTED)
      {
        // One of the children of this box will cause a manual pagebreak. We have to dive deeper into this child.
        // for now, we will only apply the ordinary shift.
        final long boxY = box.getY();
        box.setY(boxY + shift);
        updateStateKey(box);
        return true;
      }
      else // if (breakIndicator == RenderBox.BreakIndicator.NO_MANUAL_BREAK)
      {
        // As neither this box nor any of the children will cause a pagebreak, we can shift them and skip the processing
        // from here.
        BoxShifter.shiftBox(box, shift);
        updateStateKeyDeep(box);
        return false;
      }
    }

    // At this point we know, that the box may cause some shifting. It crosses at least one minor or major pagebreak.
    // Right now, we are just evaluating the next break. In a future version, we could search all possible break
    // positions up to the next major break.
    final long boxY = box.getY();
    final long boxYShifted = boxY + shift;
    final long nextMinorBreak = breakUtility.findNextBreakPosition(boxYShifted);
    final long spaceAvailable = nextMinorBreak - boxYShifted;

    // This box sits directly on a pagebreak. This means, the page is empty, and there is no need for additional
    // shifting.
    if (spaceAvailable == 0)
View Full Code Here

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

      {
        this.breakIndicatorEncountered = bmrb;
      }
    }

    final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
    final RenderLength fixedPosition = box.getBoxDefinition().getFixedPosition();
    final long fixedPositionResolved = fixedPosition.resolve(paginationTableState.getPageHeight(), 0);
    final long boxY = box.getY();
    final long shiftedBoxY = boxY + shift;
    final long nextNonShiftedMajorBreak = breakUtility.findNextMajorBreakPosition(shiftedBoxY);
    final long fixedPositionOnNextPage =
        breakUtility.computeFixedPositionInFlow(nextNonShiftedMajorBreak, fixedPositionResolved);
    final long nextMajorBreak = Math.max(nextNonShiftedMajorBreak, fixedPositionOnNextPage);
    if (nextMajorBreak < shiftedBoxY)
    {
      // This band will be outside the last pagebreak. We can only shift it normally, but there is no way
      // that we could shift it to the final position yet.
View Full Code Here

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

      final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();
      if (sblp.isAvoidPagebreakInside() || sblp.getWidows() > 0 || sblp.getOrphans() > 0)
      {
        // Check, whether this box sits on a break-position. In that case, we can call that box finished as well.
        final long boxY = box.getY();
        final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
        final long nextMinorBreak = breakUtility.findNextBreakPosition(boxY + shift);
        final long spaceAvailable = nextMinorBreak - (boxY + shift);

        // This box sits directly on a pagebreak. No matter how much content we fill in the box, it will not move.
        // This makes this box a finished box.
        if (spaceAvailable == 0 || box.isPinned())
View Full Code Here

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

  private boolean handleAutomaticPagebreak(final RenderBox box,
                                           final PaginationShiftState boxContext)
  {
    final long shift = boxContext.getShiftForNextChild();
    final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
    final long boxHeightAndWidowArea = Math.max
        (box.getHeight(), PaginationStepLib.getWidowConstraint(box, shiftState, paginationTableState));
    if (breakUtility.isCrossingPagebreak(box.getY(), boxHeightAndWidowArea, shift) == false)
    {
      // The whole box fits on the current page. No need to do anything fancy.
      final RenderBox.BreakIndicator breakIndicator = box.getManualBreakIndicator();
      if (breakIndicator == RenderBox.BreakIndicator.INDIRECT_MANUAL_BREAK)
      {
        // One of the children of this box will cause a manual pagebreak. We have to dive deeper into this child.
        // for now, we will only apply the ordinary shift.
        final long boxY = box.getY();
        box.setY(boxY + shift);
        updateStateKey(box);
        return true;
      }
      else // if (breakIndicator == RenderBox.BreakIndicator.NO_MANUAL_BREAK)
      {
        // As neither this box nor any of the children will cause a pagebreak, we can shift them and skip the processing
        // from here.
        BoxShifter.shiftBox(box, shift);
        updateStateKeyDeep(box);
        return false;
      }
    }

    // At this point we know, that the box may cause some shifting. It crosses at least one minor or major pagebreak.
    // Right now, we are just evaluating the next break. In a future version, we could search all possible break
    // positions up to the next major break.
    final long boxY = box.getY();
    final long boxYShifted = boxY + shift;
    final long nextMinorBreak = breakUtility.findNextBreakPosition(boxYShifted);
    final long spaceAvailable = nextMinorBreak - boxYShifted;

    // This box sits directly on a pagebreak. This means, the page is empty, and there is no need for additional
    // shifting.
    if (spaceAvailable == 0)
View Full Code Here

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

    if (breakIndicator != RenderBox.BreakIndicator.DIRECT_MANUAL_BREAK && breakPending == false)
    {
      return false;
    }

    final PageBreakPositions breakUtility = paginationTableState.getBreakPositions();
    final long shift = boxContext.getShiftForNextChild();
    final long boxY = box.getY();
    final long shiftedBoxY = boxY + shift;
    final long nextMajorBreak = breakUtility.findNextMajorBreakPosition(shiftedBoxY);
    if (nextMajorBreak < shiftedBoxY)
    {
      // This band will be outside the last pagebreak. We can only shift it normally, but there is no way
      // that we could shift it to the final position yet.
      box.setY(shiftedBoxY);
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.