Examples of RenderLength


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

    {
      return nodeContext.getWidth();
    }

    final long minChunkWidth;
    final RenderLength minLength;
    if (strictLegacyMode == false || box.useMinimumChunkWidth())
    {
      minChunkWidth = nodeContext.getMaxChildX2() - nodeContext.getX1();
      minLength = boxDef.getMinimumWidth();
    }
    else
    {
      minChunkWidth = nodeContext.getX2() - nodeContext.getX1();
      if (boxDef.getMinimumWidth().getValue() == 0)
      {
        minLength = FULL_WIDTH_LENGTH;
      }
      else
      {
        minLength = boxDef.getMinimumWidth();
      }
    }

    final RenderLength maxLength = boxDef.getMaximumWidth();

    final long bcw = nodeContext.getBlockContextWidth();
    final long min = minLength.resolve(bcw, 0);
    final long max = maxLength.resolve(bcw, ComputeStaticPropertiesProcessStep.MAX_AUTO);
    if (box.getBoxDefinition().isSizeSpecifiesBorderBox())
    {
      final long parentSize = nodeContext.getResolvedPreferredSize();
      // We are assuming that any size specified by the user already includes the padding and borders.
      // min-chunk-width must take insets into account. We will not add the insets to the computed width.
View Full Code Here

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

   * @return
   */
  public static long resolveNodeWidthForMinChunkCalculation(final RenderBox box)
  {
    final BoxDefinition boxDef = box.getBoxDefinition();
    final RenderLength minLength = boxDef.getMinimumWidth();
    final RenderLength prefLength = boxDef.getPreferredWidth();
    final RenderLength maxLength = boxDef.getMaximumWidth();

    final long min = minLength.resolve(0, 0);
    final long max = maxLength.resolve(0, ComputeStaticPropertiesProcessStep.MAX_AUTO);
    if (box.getBoxDefinition().isSizeSpecifiesBorderBox())
    {
      // We are assuming that any size specified by the user already includes the padding and borders.
      // min-chunk-width must take insets into account. We will not add the insets to the computed width.
      final long pref = prefLength.resolve(0, box.getInsets());
View Full Code Here

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

    {
      throw new IllegalArgumentException("ResovleSize cannot be negative");
    }

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

    final long usedHeight;
    final long childY2;
    final long childY1;
    final RenderNode lastChildNode = box.getLastChild();
    if (lastChildNode != null)
    {
      childY1 = box.getFirstChild().getCachedY();
      if (lastChildNode.isVisible())
      {
        childY2 = lastChildNode.getCachedY() + lastChildNode.getCachedHeight() + lastChildNode.getEffectiveMarginBottom();
      }
      else
      {
        childY2 = lastChildNode.getCachedY();
      }
      usedHeight = (childY2 - childY1);
    }
    else
    {
      usedHeight = 0;
      childY2 = 0;
      childY1 = 0;
    }

    //final long blockContextWidth = box.getStaticBoxLayoutProperties().getBlockContextWidth();
    final long rminH = minimumHeight.resolve(resolveSize, 0);
    final long rmaxH = maximumHeight.resolve(resolveSize, InfiniteMajorAxisLayoutStep.MAX_AUTO);

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

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

      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();

    // usedHeight already contains the insetsTop ..
    final long usedHeight;
    RenderNode child = box.getFirstChild();
    if (child != null)
    {
      long maxChildY2 = 0;
      while (child != null)
      {
        if (child.isVisible())
        {
          final long childY2 = child.getCachedY() + child.getCachedHeight() + child.getEffectiveMarginBottom();
          maxChildY2 = Math.max(childY2, maxChildY2);
        }
        child = child.getNext();
      }
      usedHeight = (maxChildY2 - box.getCachedY());
    }
    else
    {
      usedHeight = insetTop;
    }

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

    final long computedHeight; // always the height of the content box
    if (boxDefinition.isSizeSpecifiesBorderBox())
    {
      final long rprefH = preferredHeight.resolve(resolveSize, usedHeight + insetBottom);
View Full Code Here

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

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

      }
      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

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

        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

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

      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

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

      // 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

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;

    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
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.