Package org.jfree.layouting.renderer.model

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


  protected void finishBlockLevelBox(final RenderBox box)
  {
    if (box instanceof ParagraphRenderBox)
    {
      final ParagraphRenderBox paragraph = (ParagraphRenderBox) box;
      finishParagraph(paragraph);
      return;
    }
    else if (box instanceof TableRenderBox)
    {
View Full Code Here


  protected boolean startBlockBox(final BlockRenderBox box)
  {
    if (box instanceof ParagraphRenderBox)
    {
      ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;
      final boolean unchanged =
              paragraphBox.getPool().getChangeTracker() == paragraphBox.getLineBoxAge();

      if (unchanged)
      {
        final ParagraphRenderBox derivedParagraph = (ParagraphRenderBox) box.derive(true);
        breakState.getInsertationPoint().addGeneratedChild(derivedParagraph);
        final ParagraphLineBreakState item = new ParagraphLineBreakState(derivedParagraph, true);
        paragraphNesting.push(item);
        breakState = item;
        return false;
View Full Code Here

      // This is the first test case whether it is possible to avoid
      // composition-recursion on such computations. I'd prefer to have
      // an iterator pattern here ...

      // finally update the change tracker ..
      final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
      paraBox.setLineBoxAge(paraBox.getPool().getChangeTracker());

      paragraphNesting.pop();
      if (paragraphNesting.isEmpty())
      {
        breakState = null;
View Full Code Here

    if (box instanceof ParagraphRenderBox)
    {
      // No margins, no additional checks. And we can be sure that this one
      // is the only child. (This is a cheap shortcut).
      final ParagraphRenderBox paragraph = (ParagraphRenderBox) box;
      final RenderNode linebox = paragraph.getLineboxContainer();
      box.setMinimumChunkWidth(hbp + linebox.getMinimumChunkWidth());
      box.setMaximumBoxWidth(hbp + linebox.getMaximumBoxWidth());
      box.setIcmMetricsFinished(box.isOpen() == false);
      return;
    }
View Full Code Here

      processBoxChilds(box);
      finishNormalFlow(box);
    }
    else if (node instanceof ParagraphRenderBox)
    {
      final ParagraphRenderBox box = (ParagraphRenderBox) node;
      if (startBlockBox(box))
      {
        processParagraphChilds(box);
      }
      finishBlockBox(box);
    }
    else if (node instanceof LogicalPageBox)
    {
      final LogicalPageBox box = (LogicalPageBox) node;
      if (startBlockBox(box))
      {
        startProcessing(box.getHeaderArea());
        processBoxChilds(box);
        startProcessing(box.getFooterArea());
      }
      finishBlockBox(box);
    }
    else if (node instanceof BlockRenderBox)
    {
View Full Code Here

    if (breakState == null)
    {
      if (box instanceof ParagraphRenderBox)
      {
        final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;
        // We cant cache that ... the shift operations later would misbehave
        // One way around would be to at least store the layouted offsets
        // (which should be immutable as long as the line did not change its
        // contents) and to reapply them on each run. This is cheaper than
        // having to compute the whole v-align for the whole line.
View Full Code Here

      }

      if (box instanceof ParagraphRenderBox)
      {
        // finally update the change tracker ..
        final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
        paraBox.setMajorLayoutAge(paraBox.getLineboxContainer().getChangeTracker());

        breakState = null;
      }
    }
View Full Code Here

      if (box instanceof ParagraphRenderBox)
      {
        computeContentArea(box);

        final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;

        if (continuedElement == null)
        {
          final BlockRenderBox lineboxContainer = paragraphBox.getLineboxContainer();
          final boolean unchanged =
              lineboxContainer.getChangeTracker() == paragraphBox.getMinorLayoutAge();
          if (unchanged)
          {
            return false;
          }
        }

        paragraphBox.clearLayout();
        breakState = new ParagraphBreakState(paragraphBox);
      }
      else if (box instanceof TableCellRenderBox)
      {
        // todo: Cannot be done unless the inner paragraphs have been layouted once ..
View Full Code Here

      }

      if (box instanceof ParagraphRenderBox)
      {
        // finally update the change tracker ..
        final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
        paraBox.setMinorLayoutAge(paraBox.getLineboxContainer().getChangeTracker());

        breakState = null;
      }
    }
View Full Code Here

      return;
    }

    breakState.add(new EndSequenceElement(inlineRenderBox));

    final ParagraphRenderBox paragraph = breakState.getParagraph();
    final CSSValue lastLineAlignment = paragraph.getLastLineAlignment();
    final CSSValue textAlignment = paragraph.getTextAlignment();
    // Todo: Start the layouting on primary sequence ...

    // 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 TextAlignmentProcessor processor = create(textAlignment, lastLineAlignment);
    final InlineSequenceElement[] sequence = breakState.getSequence();

    if (sequence.length == 0)
    {
      return;
    }

    final long lineStart = paragraph.getContentAreaX1();
    final long lineEnd = paragraph.getContentAreaX2();
    if (lineEnd - lineStart <= 0)
    {
      final long minimumChunkWidth = paragraph.getMinimumChunkWidth();
      processor.initialize(sequence,
          lineStart, lineStart + minimumChunkWidth, pageGrid);
      DebugLog.log("Auto-Corrected zero-width linebox.");
    }
    else
    {
      processor.initialize(sequence, lineStart, lineEnd, pageGrid);
    }

    while (processor.hasNext())
    {
      final RenderNode linebox = processor.next();
      if (linebox instanceof ParagraphPoolBox == false)
      {
        throw new NullPointerException("Line must not be null");
      }

      paragraph.addGeneratedChild(linebox);
    }
  }
View Full Code Here

TOP

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

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.