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

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


    // This aligns all direct childs. Once that is finished, we have to
    // check, whether possibly existing inner-paragraphs are still valid
    // or whether moving them violated any of the inner-pagebreak constraints.

    final StaticBoxLayoutProperties blp = inlineRenderBox.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = inlineRenderBox.getBoxDefinition();
    final long insetTop = (blp.getBorderTop() + bdef.getPaddingTop());

    final long contentAreaY1 = inlineRenderBox.getCachedY() + insetTop;
    final long lineHeight = inlineRenderBox.getLineHeight();
    processor.align(boxAlignContext, contentAreaY1, lineHeight);
  }
View Full Code Here


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

      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.getNodeLayoutProperties().getPosY();
    if (node.isSizeSpecifiesBorderBox())
    {
      return (parentPosition + RenderLength.resolveLength(0, posY));
    }
    else
    {
      final long insetsTop;
      if ((node.getLayoutNodeType() & 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

  }

  private static long computeCanvasHeight(final RenderBox box)
  {
    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

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

   */
  public long getMinimumWidth(final RenderNode node)
  {
    final InlineRenderBox box = (InlineRenderBox) node;
    final StaticBoxLayoutProperties blp = box.getStaticBoxLayoutProperties();
    final BoxDefinition bdef = box.getBoxDefinition();
    return blp.getBorderRight() + bdef.getPaddingRight() + blp.getMarginRight();
  }
View Full Code Here

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

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

    // 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);
      final long specifiedHeight = ProcessUtility.computeLength(rminH, rmaxH, rprefH);
      computedHeight = Math.max(0, specifiedHeight - insetTop - insetBottom);
    }
View Full Code Here

      final StyleSheet styleSheet = new SubReportStyleSheet
          (resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.PAGEBREAK_BEFORE),
              (resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.PAGEBREAK_AFTER)));

      final SimpleStyleSheet reportStyle = new SimpleStyleSheet(styleSheet);
      final BoxDefinition boxDefinition = renderNodeFactory.getBoxDefinition(reportStyle);
      box = new BlockRenderBox
          (reportStyle, element.getObjectID(), boxDefinition, SubReportType.INSTANCE, element.getAttributes(), null);
    }
    else
    {
View Full Code Here

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

TOP

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

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.