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

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


      computeContentArea(box, computeBlockPosition(box));

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {

        final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;

        if (continuedElement == null)
        {
          final long lineBoxChangeTracker = paragraphBox.getEffectiveLineboxContainer().getChangeTracker();
          final boolean unchanged = lineBoxChangeTracker == paragraphBox.getMinorLayoutAge();
          if (unchanged)
          {
            return false;
          }
        }

        paragraphBox.clearLayout();
        breakState.init(paragraphBox);
      }
      return true;
    }
View Full Code Here


      }

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {
        // finally update the change tracker ..
        final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
        paraBox.setMinorLayoutAge(paraBox.getEffectiveLineboxContainer().getChangeTracker());

        breakState.deinit();
      }
    }
View Full Code Here

      throw new IllegalStateException("No active breakstate, finish-line cannot continue.");
    }

    breakState.add(EndSequenceElement.INSTANCE, inlineRenderBox);

    final ParagraphRenderBox paragraph = breakState.getParagraph();

    final ElementAlignment textAlignment = paragraph.getTextAlignment();
    final long textIndent = paragraph.getTextIndent();
    final long firstLineIndent = paragraph.getFirstLineIndent();
    // 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);

    final SequenceList sequence = breakState.getSequence();

    final long x2;
    final boolean overflowX = paragraph.getStaticBoxLayoutProperties().isOverflowX();
    if (overflowX)
    {
      x2 = Integer.MAX_VALUE;
    }
    else
    {
      x2 = paragraph.getContentAreaX2();
    }
    final long x1 = paragraph.getContentAreaX1();
    final long lineStart = Math.min(x2, x1 + firstLineIndent);
    final long lineEnd = x2;
    if (lineEnd - lineStart <= 0)
    {
      final long minimumChunkWidth = paragraph.getPool().getMinimumChunkWidth();
      processor.initialize(metaData, sequence, lineStart, lineStart + minimumChunkWidth, pageGrid, overflowX);
      InfiniteMinorAxisLayoutStep.logger.warn("Auto-Corrected zero-width first-line on paragraph " + paragraph.getName());
    }
    else
    {
      processor.initialize(metaData, sequence, lineStart, lineEnd, pageGrid, overflowX);
    }

    while (processor.hasNext())
    {
      final RenderNode linebox = processor.next();
      if (linebox.getNodeType() != LayoutNodeTypes.TYPE_BOX_LINEBOX)
      {
        throw new IllegalStateException("Line must not be null");
      }

      paragraph.addGeneratedChild(linebox);

      if (processor.hasNext())
      {
        final long innerLineStart = Math.min(x2, x1 + textIndent);
        final long innerLineEnd = x2;
        if (innerLineEnd - innerLineStart <= 0)
        {
          final long minimumChunkWidth = paragraph.getPool().getMinimumChunkWidth();
          processor.updateLineSize(innerLineStart, innerLineStart + minimumChunkWidth);
          InfiniteMinorAxisLayoutStep.logger.warn("Auto-Corrected zero-width text-line on paragraph " + paragraph.getName());
        }
        else
        {
          processor.updateLineSize(innerLineStart, innerLineEnd);
        }
View Full Code Here

    }
  }

  protected void updateParagraphChunkWidth(final RenderBox box)
  {
    final ParagraphRenderBox paragraphRenderBox = (ParagraphRenderBox) box;
    final RenderBox chunkBox;
    final RenderBox lineboxContainer = paragraphRenderBox.getLineboxContainer();
    if (lineboxContainer == null)
    {
      // use pool ..
      chunkBox = paragraphRenderBox.getPool();
    }
    else
    {
      chunkBox = lineboxContainer;
    }
View Full Code Here

  protected boolean startBlockBox(final BlockRenderBox box)
  {
    if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
    {
      final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;
      final long poolChangeTracker = paragraphBox.getPool().getChangeTracker();
      final boolean unchanged = poolChangeTracker == paragraphBox.getLineBoxAge();

      if (unchanged)
      {
        // If the paragraph is unchanged (no new elements have been added to the pool) then we can take a
        // shortcut. The childs of this paragraph will also be unchanged (as any structural change would have increased
        // the change-tracker).
        paragraphNesting.push(ParagraphLineBreakStep.LEAF_BREAK_STATE);
        breakState = ParagraphLineBreakStep.LEAF_BREAK_STATE;
        return false;
      }

      // When the paragraph has changed, this can only be caused by someone adding a new node to the paragraph
      // or to one of the childs.

      // Paragraphs can be nested whenever a Inline-Level element declares to be a Block-Layouter. (This is an
      // Inline-Block or Inline-Table case in CSS)

      // It is guaranteed, that if a child is changed, the parent is marked as changed as well.
      // So we have only two cases to deal with: (1) The child is unchanged (2) the child is changed.

      if (breakState == null)
      {
        final ParagraphPoolBox paragraphPoolBox = paragraphBox.getPool();
        final RenderNode firstChild = paragraphPoolBox.getFirstChild();
        if (firstChild == null)
        {
          paragraphBox.setPoolSize(0);
          paragraphBox.setLineBoxAge(paragraphPoolBox.getChangeTracker());
          breakState = ParagraphLineBreakStep.LEAF_BREAK_STATE;
          return false;
        }
        if (firstChild == paragraphPoolBox.getLastChild())
        {
          if ((firstChild.getNodeType() & LayoutNodeTypes.MASK_BOX) != LayoutNodeTypes.MASK_BOX)
          {
            // Optimize away: A single text-element or other content in a linebox. No need to dive deeper.
            paragraphBox.setPoolSize(1);
            paragraphBox.setLineBoxAge(paragraphPoolBox.getChangeTracker());
            breakState = ParagraphLineBreakStep.LEAF_BREAK_STATE;
            return false;
          }
        }
        if (paragraphBox.isComplexParagraph())
        {
          final ParagraphLinebreaker item = new FullLinebreaker(paragraphBox);
          paragraphNesting.push(item);
          breakState = item;
        }
View Full Code Here

        computeContentArea(box, computeCanvasPosition(box));
      }

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {
        final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;
        if (continuedElement == null)
        {
          final long lineBoxChangeTracker = paragraphBox.getEffectiveLineboxContainer().getChangeTracker();
          final boolean unchanged = lineBoxChangeTracker == paragraphBox.getMinorLayoutAge();
          if (unchanged)
          {
            return false;
          }
        }

        paragraphBox.clearLayout();
        breakState.init(paragraphBox);
      }
      return true;
    }
View Full Code Here

      }

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {
        // finally update the change tracker ..
        final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
        paraBox.setMinorLayoutAge(paraBox.getEffectiveLineboxContainer().getChangeTracker());

        breakState.deinit();
      }
    }
  }
View Full Code Here

        computeContentArea(box, computeRowPosition(box));
      }

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {
        final ParagraphRenderBox paragraphBox = (ParagraphRenderBox) box;
        if (continuedElement == null)
        {
          final long lineBoxChangeTracker = paragraphBox.getEffectiveLineboxContainer().getChangeTracker();
          final boolean unchanged = lineBoxChangeTracker == paragraphBox.getMinorLayoutAge();
          if (unchanged)
          {
            return false;
          }
        }

        paragraphBox.clearLayout();
        breakState.init(paragraphBox);
      }
      return true;
    }
View Full Code Here

      }

      if (box.getNodeType() == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
      {
        // finally update the change tracker ..
        final ParagraphRenderBox paraBox = (ParagraphRenderBox) box;
        paraBox.setMinorLayoutAge(paraBox.getEffectiveLineboxContainer().getChangeTracker());
        breakState.deinit();
      }
    }
  }
View Full Code Here

    {
      if ((nodeType & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
      {
        if (nodeType == LayoutNodeTypes.TYPE_BOX_PARAGRAPH)
        {
          final ParagraphRenderBox box = (ParagraphRenderBox) node;
          if (startBlockBox(box))
          {
            processParagraphChilds(box);
          }
          finishBlockBox(box);
        }
        else if (nodeType == LayoutNodeTypes.TYPE_BOX_LOGICALPAGE)
        {
          final LogicalPageBox box = (LogicalPageBox) node;
          if (startBlockBox(box))
          {
            startProcessing(box.getWatermarkArea());
            startProcessing(box.getHeaderArea());
            processBoxChilds(box);
            startProcessing(box.getFooterArea());
          }
          finishBlockBox(box);
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.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.