Package org.jfree.layouting.renderer.model

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


            final RenderNode node = contentElement.getNode();
            if (node instanceof RenderBox)
            {
              // OK, limit the size of the box to the maximum line width and
              // revalidate it.
              final RenderBox box = (RenderBox) node;
              final long maxWidth = (getEndOfLine() - getPosition());
              computeInlineBlock(box, getPosition(), maxWidth);

              elementDimensions[endIndex - 1] = node.getWidth();
            }
          }
          setSkipIndex(endIndex);
        }
        return(start);
      }

    }

    // No, it is an ordinary advance ..
    // Check, whether we hit an item-sequence element
    if (contentElement instanceof InlineNodeSequenceElement == false)
    {
      for (int i = start; i < endIndex; i++)
      {
        final InlineSequenceElement element = sequenceElements[i];
        elementPositions[i] = getPosition();
        final long elementWidth = element.getMaximumWidth();
        elementDimensions[i] = elementWidth;
        addPosition(elementWidth);
      }
      return endIndex;
    }

    // Handle the ItemSequence element.


    // This is a bit more complicated. So we encountered an inline-block
    // element here. That means, the element will try to occuppy its
    // maximum-content-width.
//    Log.debug("Advance block at index " + contentIndex);
//    final long ceWidth = contentElement.getMinimumWidth();
//    final long extraSpace = contentElement.getMaximumWidth();
//    Log.debug("Advance block: Min " + ceWidth);
//    Log.debug("Advance block: Max " + extraSpace);

    final long itemElementWidth = contentElement.getMaximumWidth();

    final RenderNode node = contentElement.getNode();
    if (node instanceof RenderBox)
    {
      final RenderBox box = (RenderBox) node;
      computeInlineBlock(box, getPosition(), itemElementWidth);
    }
    else
    {
      node.setX(getPosition());
View Full Code Here


    // for now, we ignore most of the stuff, and assume that orphans and
    // widows count for paragraphs and tables, and not for the ordinary stuff.
    final RenderNode firstNode = findNonFinishedVisibleFirst (box);
    if (firstNode instanceof RenderBox)
    {
      final RenderBox firstBox = (RenderBox) firstNode;
      box.setOrphansSize(firstBox.getOrphansSize());
    }
    else if (firstNode != null)
    {
      box.setOrphansSize(firstNode.getHeight());
    }

    final RenderNode lastNode = findNonFinishedVisibleLast(box);
    if (lastNode instanceof RenderBox)
    {
      final RenderBox lastBox = (RenderBox) lastNode;
      box.setWidowsSize(lastBox.getOrphansSize());
    }
    else if (lastNode != null)
    {
      box.setWidowsSize(lastNode.getHeight());
    }
View Full Code Here

      {
        node = node.getVisibleNext();
        continue;
      }

      final RenderBox cellBox = (RenderBox) node;
      orphanSize = Math.max (cellBox.getOrphansSize(), orphanSize);
      widowSize = Math.max (cellBox.getWidowsSize(), widowSize);
      linecount = Math.max (cellBox.getLineCount(), linecount);
      node = node.getVisibleNext();
    }

    box.setOrphansSize(orphanSize);
    box.setWidowsSize(widowSize);
View Full Code Here

    RenderNode node = box.getVisibleFirst();
    if (node instanceof RenderBox)
    {
      // This is not very valid now.
      final RenderBox firstBox = (RenderBox) node;
      box.setOrphansSize(firstBox.getOrphansSize());
    }
    else
    {
      box.setOrphansSize(box.getHeight());
    }


    node = box.getVisibleLast();
    if (node instanceof RenderBox)
    {
      final RenderBox lastBox = (RenderBox) node;
      box.setWidowsSize(lastBox.getWidowsSize());
    }
    else
    {
      box.setWidowsSize(box.getHeight());
    }
View Full Code Here

         // bugs in the code ..
          throw new IllegalStateException
                  ("A child cannot be dirty, if the parent is clean");
        }
        // The paragraph is somehow nested in an other paragraph.
        final RenderBox child = (RenderBox) box.deriveFrozen(false);
        breakState.getInsertationPoint().addGeneratedChild(child);
        //breakState.setInsertationPoint(child);
        paragraphBox = (ParagraphRenderBox) child;
      }

      final ParagraphLineBreakState item = new ParagraphLineBreakState(paragraphBox, false);
      paragraphNesting.push(item);
      breakState = item;
    }
    else
    {
      // some other block box .. suspend.
      if (breakState != null)
      {
        if (breakState.isDirty())
        {
          final RenderBox child = (RenderBox) box.deriveFrozen(false);
          breakState.getInsertationPoint().addGeneratedChild(child);
          breakState.setInsertationPoint(child);

          if (breakState.getSuspendItem() == null)
          {
View Full Code Here

    {
      if (breakState != null)
      {
        if (breakState.isDirty())
        {
          final RenderBox parent = breakState.getInsertationPoint().getParent();
          breakState.setInsertationPoint(parent);

          final Object suspender = breakState.getSuspendItem();
          if (box.getInstanceId() == suspender)
          {
View Full Code Here

    if (breakState == null || breakState.isDirty() == false)
    {
      return true;
    }

    final RenderBox child = (RenderBox) box.deriveFrozen(false);
    breakState.getInsertationPoint().addGeneratedChild(child);
    breakState.setInsertationPoint(child);
    return true;
  }
View Full Code Here

    if (breakState == null || breakState.isDirty() == false)
    {
      return;
    }

    final RenderBox parent = breakState.getInsertationPoint().getParent();
    breakState.setInsertationPoint(parent);

    if (breakState.isBreakRequested() && box.getNext() != null)
    {
      performBreak();
View Full Code Here

    // Fill a stack with the current context ..
    // Check if we are at the end of the line
    if (node.getNext() == null)
    {
      boolean endOfLine = true;
      RenderBox parent = node.getParent();
      while (parent != null)
      {
        if (parent instanceof InlineRenderBox == false)
        {
          break;
        }
        if (parent.getNext() != null)
        {
          endOfLine = false;
          break;
        }
        parent = parent.getParent();
      }

      // OK, if we are at the end of the line (for all contexts), so we
      // dont have to perform a break. The text will end anyway ..
      if (endOfLine)
View Full Code Here

    // needed to split the box at all. Just let it end naturally is enough for
    // them to look good.

    // As the real context (from the break-State) is currently being built,
    // we have to use the original pool to query the 'is-end-of-line' flag.
    RenderBox context = breakState.getInsertationPoint();
    final BlockRenderBox lines = breakState.getLines();
    while (context != lines)
    {
      // save the context ..
      if (context instanceof InlineRenderBox == false)
      {
        throw new IllegalStateException
                ("Confused: I expect InlineBoxes ..");
      }

      final InlineRenderBox inline = (InlineRenderBox) context;
      contexts.push(inline.split(RenderNode.HORIZONTAL_AXIS));
      context = context.getParent();
    }

    // reset to a known state and add all saved contexts ..
    breakState.setInsertationPoint(lines);
    while (contexts.isEmpty() == false)
    {
      final RenderBox box = (RenderBox) contexts.pop();
      breakState.getInsertationPoint().addGeneratedChild(box);
      breakState.setInsertationPoint(box);
    }

    breakState.setBreakRequested(false);
View Full Code Here

TOP

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

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.