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

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


  {
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = box.getBoxDefinition();

    final BoxDefinition boxDefinition = box.getBoxDefinition();
    final RenderLength minHeight = boxDefinition.getMinimumHeight();
    final RenderLength preferredHeight = boxDefinition.getPreferredHeight();
    final RenderLength maxHeight = boxDefinition.getMaximumHeight();

    final long insetsTop = (blp.getBorderTop() + bdef.getPaddingTop());
    final long insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();
    final long insets = insetsTop + insetsBottom;

    // find the maximum of the used height (for all childs) and the specified min-height.
    final long minHeightResolved = minHeight.resolve(0);
    long consumedHeight;
    if (box.isSizeSpecifiesBorderBox())
    {
      consumedHeight = Math.max(minHeightResolved, insets) - insetsBottom;
    }
    else
    {
      consumedHeight = minHeightResolved + insetsTop;
    }

    final long boxY = box.getCachedY();

    RenderNode node = box.getFirstChild();
    while (node != null)
    {
      final long childY2 = (node.getCachedY() + node.getCachedHeight());
      final long childLocalY2 = childY2 - boxY;
      if (childLocalY2 > consumedHeight)
      {
        consumedHeight = childLocalY2;
      }
      node = node.getNext();
    }

    consumedHeight += insetsBottom;

    // The consumed height computed above specifies the size at the border-edge.
    // However, depending on the box-sizing property, we may have to resolve them against the
    // content-edge instead.

    final long maxHeightResolved = maxHeight.resolve(0, InfiniteMajorAxisLayoutStep.MAX_AUTO);
    if (box.isSizeSpecifiesBorderBox())
    {
      final long prefHeightResolved;
      if (RenderLength.AUTO.equals(preferredHeight))
      {
View Full Code Here


      }
      breakPending = false;
    }

    // If this box does not cross any (major or minor) break, it may need no additional shifting at all.
    final RenderLength fixedPositionLength = box.getBoxDefinition().getFixedPosition();
    if (shiftState.isManualBreakSuspended() ||
        RenderLength.AUTO.equals(fixedPositionLength) ||
        paginationTableState.isFixedPositionProcessingSuspended())
    {
      return handleAutomaticPagebreak(box, shiftState);
    }

    // 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.
View Full Code Here

        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);
View Full Code Here

      return lpb.getPageHeight();
    }

    // Check the height. Set the height.
    final BoxDefinition boxDefinition = box.getBoxDefinition();
    final RenderLength preferredHeight = boxDefinition.getPreferredHeight();
    final RenderLength minimumHeight = boxDefinition.getMinimumHeight();
    final RenderLength maximumHeight = boxDefinition.getMaximumHeight();

    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final long insetBottom = blp.getBorderBottom() + boxDefinition.getPaddingBottom();
    final long insetTop = blp.getBorderTop() + boxDefinition.getPaddingTop();

    final long usedHeight;
    RenderNode child = box.getFirstChild();
    // initialize with the values computed in the InfMajorStep
    long maxChildY2 = box.getCachedY() + box.getCachedHeight();
    if (child != null)
    {
      while (child != null)
      {
        maxChildY2 = Math.max(child.getCachedY() + child.getCachedHeight() + child.getEffectiveMarginBottom(),
            maxChildY2);

        child = child.getNext();
      }
      usedHeight = (maxChildY2 - (box.getCachedY() + insetTop));
    }
    else
    {
      usedHeight = 0;
    }

    final long rminH = minimumHeight.resolve(resolveSize, 0);
    final long rmaxH = maximumHeight.resolve(resolveSize, CanvasMajorAxisLayoutStep.MAX_AUTO);

    final long computedContentHeight;
    if (boxDefinition.isSizeSpecifiesBorderBox())
    {
      final long rprefH = preferredHeight.resolve(resolveSize, usedHeight + insetTop + insetBottom);
View Full Code Here

      // a preferred height may create overflowing childs, as it limits the height of the box to the defined value
      if (RenderLength.AUTO.equals(bdef.getPreferredHeight()))
      {
        // the check is only valid if there is no max height
        // a max height may create overflowing childs, as it limits the height of the box to the defined value
        final RenderLength maxHeight = bdef.getMaximumHeight();
        if (RenderLength.AUTO.equals(maxHeight))
        {
          final long childConsumedHeight = parentAvailableHeight - node.getCachedHeight();
          if (childConsumedHeight < 0)
          {
View Full Code Here

  {
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = box.getBoxDefinition();

    final BoxDefinition boxDefinition = box.getBoxDefinition();
    final RenderLength minHeight = boxDefinition.getMinimumHeight();
    final RenderLength preferredHeight = boxDefinition.getPreferredHeight();
    final RenderLength maxHeight = boxDefinition.getMaximumHeight();

    final long insetsTop = (blp.getBorderTop() + bdef.getPaddingTop());
    final long insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();
    final long insets = insetsTop + insetsBottom;

    final long parentHeight;
    final long usableParentHeight;
    if (heightResolvesToZero)
    {
      parentHeight = 0;
      usableParentHeight = 0;
    }
    else
    {
      parentHeight = Math.max(resolveParentHeight(box), box.getCachedHeight());
      usableParentHeight = resolveUseableParentHeight(box);
    }
    // find the maximum of the used height (for all childs) and the specified min-height.
    long consumedHeight = Math.max(box.getCachedHeight(),
        Math.min(minHeight.resolve(parentHeight), usableParentHeight));

    // The consumed height computed above specifies the size at the border-edge.
    // However, depending on the box-sizing property, we may have to resolve them against the
    // content-edge instead.

    final long minHeightResolved = minHeight.resolve(parentHeight);
    final long maxHeightResolved = maxHeight.resolve(parentHeight, CanvasMajorAxisLayoutStep.MAX_AUTO);
    if (box.isSizeSpecifiesBorderBox())
    {
      final long prefHeightResolved;
      if (RenderLength.AUTO.equals(preferredHeight))
      {
View Full Code Here

    {
      return;
    }

    final Border border = node.getBoxDefinition().getBorder();
    final RenderLength length = node.getBoxDefinition().getMinimumWidth();

    if (currentColumnGroup != null)
    {
      currentColumnGroup.addColumn(new TableColumn(border, length, false));
    }
View Full Code Here

TOP

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

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.