Examples of BoxDefinition


Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

        return (marginTop + prev.getCachedY() + prev.getCachedHeight());
      }
      else
      {
        final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
        final BoxDefinition bdef = parent.getBoxDefinition();
        final long insetTop = (blp.getBorderTop() + bdef.getPaddingTop());

        return (marginTop + insetTop + parent.getCachedY());
      }
    }
    else
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

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

    // 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 long usedHeight;
    final long childY2;
    final long childY1;
    final RenderNode lastChildNode = box.getLastChild();
    if (lastChildNode != null)
    {
      childY1 = box.getFirstChild().getCachedY();
      childY2 = lastChildNode.getCachedY() + lastChildNode.getCachedHeight() + lastChildNode.getEffectiveMarginBottom();
      usedHeight = (childY2 - childY1);
    }
    else
    {
      usedHeight = 0;
      childY2 = 0;
      childY1 = 0;
    }

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

    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final long insetBottom = blp.getBorderBottom() + boxDefinition.getPaddingBottom();
    final long insetTop = blp.getBorderTop() + boxDefinition.getPaddingTop();
//todo
    final long computedContentHeight;
    if (boxDefinition.isSizeSpecifiesBorderBox())
    {
      final long rprefH = preferredHeight.resolve(resolveSize, usedHeight + insetTop + insetBottom);
      final long specifiedHeight = ProcessUtility.computeLength(rminH, rmaxH, rprefH);
      computedContentHeight = specifiedHeight - insetTop - insetBottom;
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

      // set the page-height as watermark size.
      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);
      final long specifiedHeight = ProcessUtility.computeLength(rminH, rmaxH, rprefH);
      computedContentHeight = specifiedHeight - insetTop - insetBottom;
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

      parentPosition = 0;
    }
    else
    {
      final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
      final BoxDefinition bdef = parent.getBoxDefinition();
      final long insetsTop = (blp.getBorderTop() + bdef.getPaddingTop());
      parentPosition = parent.getCachedY() + insetsTop;
    }

    final double posY = node.getStyleSheet().getDoubleStyleProperty(ElementStyleKeys.POS_Y, 0);
    if (node.isSizeSpecifiesBorderBox())
    {
      return (parentPosition + RenderLength.resolveLength(resolveParentHeight(node), posY));
    }
    else
    {
      final long insetsTop;
      if ((node.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX)
      {
        final RenderBox box = (RenderBox) node;
        final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
        final BoxDefinition bdef = box.getBoxDefinition();
        insetsTop = (blp.getBorderTop() + bdef.getPaddingTop());
      }
      else
      {
        insetsTop = 0;
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

    if (parent == null)
    {
      return node.getCachedHeight();
    }
    final long height = parent.getCachedHeight();
    final BoxDefinition bdef = parent.getBoxDefinition();
    final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
    final long insetsBottom = blp.getBorderBottom() + bdef.getPaddingBottom();
    final long parentAvailableHeight = (parent.getCachedY() + height - insetsBottom) - node.getCachedY();
    if (PARANOID_CHECKS && isWatermark(parent) == null)
    {
      // the check is only valid if there is no preferred height
      // 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) ||
            (maxHeight.isPercentage() == false && maxHeight.getValue() >= StrictGeomUtility.toInternalValue(
                Short.MAX_VALUE)))
        {
          final long childConsumedHeight = parentAvailableHeight - node.getCachedHeight();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

  //todo
  private long computeCanvasHeight(final RenderBox box, final boolean heightResolvesToZero)
  {
    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;
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

      // A inline-box always has an other inline-box as parent (the paragraph-pool-box is the only exception;
      // and this one is handled elsewhere).

      // Top and bottom margins are not applied to inline-elements.
      final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
      final BoxDefinition bdef = parent.getBoxDefinition();
      final long insetTop = (blp.getBorderTop() + bdef.getPaddingTop());

      return (insetTop + parent.getCachedY());
    }
    else
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

    computeLegacyBackground(box);
  }

  private void computeLegacyBackground(final RenderableReplacedContentBox node)
  {
    final BoxDefinition sblp = node.getBoxDefinition();
    final long nodeX = node.getX() + sblp.getPaddingLeft();
    final long nodeY = node.getY() + sblp.getPaddingTop();
    final long nodeWidth = node.getWidth() - sblp.getPaddingLeft() - sblp.getPaddingRight();
    final long nodeHeight = node.getHeight() - sblp.getPaddingTop() - sblp.getPaddingBottom();
    final int backgroundHint = computeBackground(nodeX, nodeY, nodeWidth, nodeHeight);
    if (backgroundHint == BACKGROUND_NONE)
    {
      return;
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

    super(string);
  }

  public void testSingleElementReplacement()
  {
    final BlockRenderBox parent = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox first = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox second = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(),new InstanceID(), new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox third = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox fourth = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);

    parent.addChild(first);
    parent.addChild(second);
    parent.addChild(third);
    parent.addChild(fourth);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

    assertNull(fourth.getParent());
  }

  public void testMore()
  {
    final BlockRenderBox parent = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(),new InstanceID(), new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox first = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(),new InstanceID(), new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox second = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox third = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(),new InstanceID(), new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);
    final BlockRenderBox fourth = new BlockRenderBox(ElementDefaultStyleSheet.getDefaultStyle(), new InstanceID(),new BoxDefinition(), LegacyType.INSTANCE, ReportAttributeMap.EMPTY_MAP, null);

    parent.addChild(first);
    parent.addChild(second);
    parent.addChild(third);
    parent.addChild(fourth);
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.