Package org.jfree.layouting.renderer.model

Examples of org.jfree.layouting.renderer.model.RenderNode


  }

  protected void processBoxChilds(final RenderBox box)
  {
    RenderNode node = box.getFirstChild();
    while (node != null)
    {
      startProcessing(node);
      node = node.getNext();
    }
  }
View Full Code Here


    {
      // check, if the section contains row-spanning cell declarations.
      // if it does, check whether there are enough rows to make these
      // constraints valid. If there are rows missing, then the section
      // is not layoutable..
      RenderNode node = box.getFirstChild();
      int expectedRows = 0;
      while (node != null)
      {
        if (node instanceof TableRowRenderBox == false)
        {
          node = node.getNext();
          continue;
        }

        expectedRows -= 1;

        final TableRowRenderBox row = (TableRowRenderBox) node;
        final TableRowInfoStructure rowInfoStructure = row.getRowInfoStructure();
        if (rowInfoStructure.isValidationDone())
        {
          // ok, we can take the shortcut ..
          final int cellCount = rowInfoStructure.getCellCount();
          for (int i = 0; i < cellCount; i++)
          {
            final TableCell cellAt = rowInfoStructure.getCellAt(i);
            expectedRows = Math.max (expectedRows, cellAt.getRowSpan() - 1);
          }
        }
        else
        {
          // the slow-lane: Look at the already declared cells ..
          RenderNode nodeCell = row.getFirstChild();
          while (nodeCell != null)
          {
            if (nodeCell instanceof TableCellRenderBox)
            {
              final TableCellRenderBox cellBox = (TableCellRenderBox) nodeCell;
              expectedRows = Math.max (expectedRows, cellBox.getRowSpan() - 1);
            }
            nodeCell = nodeCell.getNext();
          }
        }
        node = node.getNext();
      }
View Full Code Here

      }

      // now dive deeper. Seek the first occurence of an table-body element..
      boolean foundBodyGroup = false;

      RenderNode node = table.getFirstChild();
      while (node != null)
      {
        if (node instanceof TableSectionRenderBox)
        {
          final TableSectionRenderBox section = (TableSectionRenderBox) node;
          if (DisplayRole.TABLE_ROW_GROUP.equals(section.getDisplayRole()))
          {
            foundBodyGroup = true;
            boolean foundRow = false;
            // We found a tbody element ..
            // next - check whether the first row is closed ..
            RenderNode maybeRow = section.getVisibleFirst();
            while (maybeRow != null)
            {
              if (maybeRow instanceof TableRowRenderBox)
              {
                if (maybeRow.isOpen())
                {
                  // not layoutable - bail out ..
                  layoutFailureNodeId = maybeRow.getInstanceId();
                  layoutFailureResolution = BOX_MUST_BE_CLOSED;
                  return false;
                }
                foundRow = true;
              }
              maybeRow = maybeRow.getNext();
            }

            if (foundRow == false)
            {
              // not layoutable - bail out ..
View Full Code Here

    }


    final boolean infiniteMarginTop;
    final RenderBox boxParent = box.getParent();
    final RenderNode visiblePrev = box.getVisiblePrev();
    if (boxParent == null)
    {
      infiniteMarginTop = (visiblePrev == null);
    }
    else
    {
      final ComputedLayoutProperties sBlp = boxParent.getComputedLayoutProperties();
      final BoxLayoutProperties pBlp = boxParent.getBoxLayoutProperties();
      infiniteMarginTop =
          (pBlp.isInfiniteMarginTop() && visiblePrev == null &&
          sBlp.getBorderTop() == 0 && sBlp.getPaddingTop() != 0);
    }

    marginCollection.clear();

    // Collect all elements that will contribute to the margins.
    RenderBox marginBox = box;
    while (true)
    {
      marginCollection.add(marginBox);

      final ComputedLayoutProperties cblp = marginBox.getComputedLayoutProperties();
      if (cblp.getBorderBottom() != 0)
      {
        break;
      }
      if (cblp.getPaddingBottom() != 0)
      {
        break;
      }

      final RenderNode node = marginBox.getVisibleFirst();
      if (node instanceof RenderBox == false)
      {
        break;
      }
View Full Code Here

      node.setY(parent.getY());
    }
    // If the box's parent is a block box ..
    else if (parent instanceof BlockRenderBox)
    {
      final RenderNode prev = node.getVisiblePrev();
      if (prev != null)
      {
        // we have a silbling. Position yourself directly below your silbling ..
        node.setDirty(true);
        node.setY(marginTop + prev.getY() + prev.getHeight());
      }
      else
      {
        final ComputedLayoutProperties blp = parent.getComputedLayoutProperties();
        final long insetTop = (blp.getBorderTop() + blp.getPaddingTop());
View Full Code Here

        preferredHeight.resolve(computedWidth.resolve(0));

    final ComputedLayoutProperties blp = box.getComputedLayoutProperties();
    final long insetBottom = blp.getBorderBottom() + blp.getPaddingBottom();

    final RenderNode lastChildNode = box.getLastChild();
    if (lastChildNode != null)
    {
      // grab the node's y2
      final long childY2 = lastChildNode.getY() + lastChildNode.getHeight() +
          lastChildNode.getEffectiveMarginBottom();
      final long effectiveHeight = (childY2 - box.getY()) + insetBottom;
      final long height = Math.max(effectiveHeight, computedHeight);
      box.setHeight(height);
    }
    else
View Full Code Here

    return false;
  }

  private void computeBaselineInfo(final RenderBox box)
  {
    RenderNode node = box.getVisibleFirst();
    while (node != null)
    {
      if (node instanceof RenderableText)
      {
        // grab the baseline info from there ...
        final RenderableText text = (RenderableText) node;
        box.setBaselineInfo(text.getBaselineInfo());
        break;
      }

      node = node.getVisibleNext();
    }

    if (box.getBaselineInfo() == null)
    {
      // If we have no baseline info here, ask the parent. If that one has none
View Full Code Here

  protected void processParagraphChilds(final ParagraphRenderBox box)
  {
    // Process the direct childs of the paragraph
    // Each direct child represents a line ..

    RenderNode node = box.getVisibleFirst();
    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 instanceof ParagraphPoolBox == false)
      {
        throw new IllegalStateException("Encountered " + node.getClass());
      }
      final ParagraphPoolBox inlineRenderBox = (ParagraphPoolBox) node;
      startLine(inlineRenderBox);
      processBoxChilds(inlineRenderBox);
      finishLine(inlineRenderBox);

      node = node.getVisibleNext();
    }

  }
View Full Code Here

    {
      return offset;
    }

    final ExtendedBaselineInfo baselineInfo;
    final RenderNode node = sequenceElement.getNode();
    if (sequenceElement instanceof TextSequenceElement)
    {
      final RenderableText text = (RenderableText) node;
      baselineInfo = text.getBaselineInfo();
    }
View Full Code Here

  }

  protected void processParagraphChilds(final ParagraphRenderBox box)
  {
    final BlockRenderBox lineboxContainer = box.getLineboxContainer();
    RenderNode node = lineboxContainer.getVisibleFirst();
    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 instanceof ParagraphPoolBox == false)
      {
        throw new IllegalStateException("Expected ParagraphPoolBox elements.");
      }
      final InlineRenderBox inlineRenderBox = (InlineRenderBox) node;
      startLine(inlineRenderBox);
      processBoxChilds(inlineRenderBox);
      finishLine(inlineRenderBox);

      node = node.getVisibleNext();
    }

  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.model.RenderNode

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.