Examples of RenderNode


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

        this.finalVisibleState = stateKey;
        return true;
      }
      else
      {
        RenderNode lastChild = box.getLastChild();
        while (lastChild != null)
        {
          if (((lastChild.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX) == false)
          {
            lastChild = lastChild.getPrev();
            continue;
          }
          final RenderBox lastBox = (RenderBox) lastChild;
          if (updateStateKeyDeep(lastBox))
          {
View Full Code Here

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

    if (box == null)
    {
      return;
    }
    long x = x2;
    RenderNode node = box.getLastChild();
    while (node != null)
    {
      final long nodeWidth = node.getMaximumBoxWidth();
      node.setX(x - nodeWidth);
      node.setWidth(node.getMaximumBoxWidth());
      node.setY(box.getY());
      node.setHeight(box.getHeight());

      node = node.getNext();
      x -= nodeWidth;
    }
    box.setX(x);
    box.setWidth(x2 - x);
    box.setContentAreaX1(x);
View Full Code Here

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

    {
      return marginTop;
    }
    if ((parent.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
    {
      final RenderNode prev = node.getPrev();
      if (prev != null)
      {
        // we have a silbling. Position yourself directly below your silbling ..
        return (marginTop + prev.getCachedY() + prev.getCachedHeight());
      }
      else
      {
        final StaticBoxLayoutProperties blp = parent.getStaticBoxLayoutProperties();
        final BoxDefinition bdef = parent.getBoxDefinition();
View Full Code Here

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

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

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

    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;
    }
    else
    {
      final long rprefH = preferredHeight.resolve(resolveSize, usedHeight);
      computedContentHeight = ProcessUtility.computeLength(rminH, rmaxH, rprefH);
    }

    child = box.getFirstChild();
    final ElementAlignment valign = box.getNodeLayoutProperties().getVerticalAlignment();
    final long boxY1 = box.getCachedY() + insetTop;
    final long boxY2 = boxY1 + computedContentHeight;
    while (child != null)
    {
      final long childY1 = child.getCachedY();
      final long childY2 = childY1 + child.getCachedHeight();
      // we have extra space to distribute. So lets shift some boxes.
      if (ElementAlignment.BOTTOM.equals(valign))
      {
        final long boxBottom = (boxY2 - insetBottom);
        final long delta = boxBottom - childY2;
        CacheBoxShifter.shiftBox(child, delta);
      }
      else if (ElementAlignment.MIDDLE.equals(valign))
      {
        final long extraHeight = computedContentHeight - (childY2 - childY1);
        final long boxTop = boxY1 + (extraHeight / 2);
        final long delta = boxTop - childY1;
        CacheBoxShifter.shiftBox(child, delta);
      }
      child = child.getNext();
    }

    final long retval = Math.max(0, computedContentHeight + insetTop + insetBottom);
    if (retval < 0)
    {
View Full Code Here

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

   * @param box
   * @return
   */
  protected boolean startBlockLevelBox(final RenderBox box)
  {
    RenderNode node = box.getFirstChild();
    while (node != null)
    {
      if (node.isIgnorableForRendering())
      {
        node = node.getNext();
        continue;
      }
      // Special treatment for lines, which have a height of zero.
      if (node.getY() == contentStart && node.getHeight() == 0)
      {
        node = node.getNext();
      }
      else if ((node.getY() + node.getHeight()) <= contentStart)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else if (node.getY() > contentEnd)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else
      {
View Full Code Here

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

    return true;
  }

  protected boolean startRowLevelBox(final RenderBox box)
  {
    RenderNode node = box.getFirstChild();
    while (node != null)
    {
      if (node.isIgnorableForRendering())
      {
        node = node.getNext();
        continue;
      }
      // Special treatment for lines, which have a height of zero.
      if (node.getY() == contentStart && node.getHeight() == 0)
      {
        node = node.getNext();
      }
      else if ((node.getY() + node.getHeight()) <= contentStart)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else if (node.getY() >= contentEnd)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else
      {
View Full Code Here

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

    return true;
  }

  protected boolean startCanvasLevelBox(final RenderBox box)
  {
    RenderNode node = box.getFirstChild();
    while (node != null)
    {
      if (node.isIgnorableForRendering())
      {
        node = node.getNext();
        continue;
      }
      // Special treatment for lines, which have a height of zero.
      if (node.getY() == contentStart && node.getHeight() == 0)
      {
        node = node.getNext();
      }
      else if ((node.getY() + node.getHeight()) <= contentStart)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else if (node.getY() >= contentEnd)
      {
        final RenderNode next = node.getNext();
        box.remove(node);
        node = next;
      }
      else
      {
View Full Code Here

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

  }

  private void performVerticalBlockAlignment(final ParagraphRenderBox box)
  {

    final RenderNode lastChildNode = box.getLastChild();

    if (lastChildNode == null)
    {
      return;
    }

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

    final long childY2 = lastChildNode.getCachedY() + lastChildNode.getCachedHeight() +
        lastChildNode.getEffectiveMarginBottom();
    final long childY1 = box.getFirstChild().getCachedY();
    final long usedHeight = (childY2 - childY1);

    final long computedHeight = box.getCachedHeight();
    if (computedHeight > usedHeight)
View Full Code Here

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

    // Process the direct childs of the paragraph
    // Each direct child represents a line ..
    final long paragraphBottom = paragraph.getCachedY() + paragraph.getCachedHeight();

    final RenderNode lastLine = paragraph.getLastChild();
    if (lastLine == null)
    {
      // Empty paragraph, no need to do anything ...
      return;
    }

    if ((lastLine.getCachedY() + lastLine.getCachedHeight()) <= paragraphBottom)
    {
      // Already perfectly aligned.
      return;
    }

    RenderNode node = paragraph.getFirstChild();
    ParagraphPoolBox prev = null;
    while (node != null)
    {
      // all childs of the linebox container must be inline boxes. They
      // represent the lines in the paragraph. Any other element here is
      // a error that must be reported
      if (node.getNodeType() != LayoutNodeTypes.TYPE_BOX_LINEBOX)
      {
        throw new IllegalStateException("Encountered " + node.getClass());
      }

      final ParagraphPoolBox inlineRenderBox = (ParagraphPoolBox) node;
      // Process the current line.
      final long y = inlineRenderBox.getCachedY();
      final long height = inlineRenderBox.getCachedHeight();
      if (y + height <= paragraphBottom)
      {

        // Node will fit, so we can allow it ..
        prev = inlineRenderBox;
        node = node.getNext();
        continue;
      }

      // Encountered a paragraph that will not fully fit into the paragraph.
      // Merge it with the previous line-paragraph.
      final ParagraphPoolBox mergedLine = rebuildLastLine(prev, inlineRenderBox);

      // now remove all pending lineboxes (they should be empty anyway).
      while (node != null)
      {
        final RenderNode oldNode = node;
        node = node.getNext();
        paragraph.remove(oldNode);
      }

      if (mergedLine == null)
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.