Examples of SequenceList


Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

      final LastLineTextAlignmentProcessor proc = create(textAlignment);

      // Now Build the sequence list that holds all nodes for the horizontal alignment computation.
      // The last line will get a special "last-line" horizontal alignment. This is quite usefull if
      // we are working with justified text and want the last line to be left-aligned.
      final SequenceList sequenceList = createHorizontalSequenceList(mergedLine);
      final long lineStart = paragraph.getContentAreaX1();
      final long lineEnd;

      if (overflowX)
      {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

  }


  private SequenceList createHorizontalSequenceList(final InlineRenderBox box)
  {
    final SequenceList sequenceList = new SequenceList();
    sequenceList.add(StartSequenceElement.INSTANCE, box);

    RenderNode next = box.getFirstChild();
    RenderBox context = box;

    final FastStack contextStack = new FastStack(50);
    boolean containsContent = false;

    while (next != null)
    {
      // process next
      if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          // Open a non-empty box context
          contextStack.push(context);
          next = firstChild;

          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          context = nBox;
        }
        else
        {
          // Process an empty box.
          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          sequenceList.add(EndSequenceElement.INSTANCE, nBox);
          next = nBox.getNext();
        }
      }
      else
      {
        // Process an ordinary node.
        if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_TEXT)
        {
          sequenceList.add(TextSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_BOX_CONTENT)
        {
          sequenceList.add(ReplacedContentSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_SPACER)
        {
          if (containsContent)
          {
            sequenceList.add(SpacerSequenceElement.INSTANCE, next);
          }
        }
        else if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
        {
          containsContent = true;
          sequenceList.add(InlineBoxSequenceElement.INSTANCE, next);
        }
        else
        {
          containsContent = true;
          sequenceList.add(InlineNodeSequenceElement.INSTANCE, next);
        }
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
        // Finish the current box context, if needed
        sequenceList.add(EndSequenceElement.INSTANCE, context);
        next = context.getNext();
        context = (RenderBox) contextStack.pop();
      }
    }

    sequenceList.add(EndSequenceElement.INSTANCE, box);
    return sequenceList;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

  private ParagraphRenderBox paragraph;
  private boolean containsContent;

  public MinorAxisParagraphBreakState()
  {
    this.primarySequence = new SequenceList();
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

    // 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)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

    // 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 lineEnd;
    final boolean overflowX = paragraph.getStaticBoxLayoutProperties().isOverflowX();
    if (overflowX)
    {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

      final LastLineTextAlignmentProcessor proc = create(textAlignment);

      // Now Build the sequence list that holds all nodes for the horizontal alignment computation.
      // The last line will get a special "last-line" horizontal alignment. This is quite usefull if
      // we are working with justified text and want the last line to be left-aligned.
      final SequenceList sequenceList = createHorizontalSequenceList(mergedLine);
      final long lineStart = paragraph.getContentAreaX1();
      final long lineEnd;

      if (overflowX)
      {
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

    return alignContext;
  }

  private SequenceList createHorizontalSequenceList(final InlineRenderBox box)
  {
    final SequenceList sequenceList = new DefaultSequenceList();
    sequenceList.add(StartSequenceElement.INSTANCE, box);

    RenderNode next = box.getFirstChild();
    RenderBox context = box;

    final FastStack<RenderBox> contextStack = new FastStack<RenderBox>(50);
    boolean containsContent = false;

    while (next != null)
    {
      // process next
      final int nodeType = next.getLayoutNodeType();
      if ((nodeType & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          // Open a non-empty box context
          contextStack.push(context);
          next = firstChild;

          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          context = nBox;
        }
        else
        {
          // Process an empty box.
          sequenceList.add(StartSequenceElement.INSTANCE, nBox);
          sequenceList.add(EndSequenceElement.INSTANCE, nBox);
          next = nBox.getNext();
        }
      }
      else
      {
        // Process an ordinary node.
        if (nodeType == LayoutNodeTypes.TYPE_NODE_TEXT)
        {
          sequenceList.add(TextSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (nodeType == LayoutNodeTypes.TYPE_BOX_CONTENT)
        {
          sequenceList.add(ReplacedContentSequenceElement.INSTANCE, next);
          containsContent = true;
        }
        else if (nodeType == LayoutNodeTypes.TYPE_NODE_SPACER)
        {
          if (containsContent)
          {
            sequenceList.add(SpacerSequenceElement.INSTANCE, next);
          }
        }
        else if ((nodeType & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
        {
          containsContent = true;
          sequenceList.add(InlineBoxSequenceElement.INSTANCE, next);
        }
        else
        {
          containsContent = true;
          sequenceList.add(InlineNodeSequenceElement.INSTANCE, next);
        }
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
        // Finish the current box context, if needed
        sequenceList.add(EndSequenceElement.INSTANCE, context);
        next = context.getNext();
        context = contextStack.pop();
      }
    }

    sequenceList.add(EndSequenceElement.INSTANCE, box);
    return sequenceList;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

    assertEquals(width, next.getWidth());
  }

  public void testSequenceBuilding1()
  {
    final SequenceList list = new DefaultSequenceList();
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.START), new SpacerRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.END), new SpacerRenderNode());

    final ChunkIterator it = new ChunkIterator(list, 0);
    assertNext(it, 0, 2, 20);
    assertNext(it, 2, 2, 20);
    assertFalse(it.hasNext());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

    assertFalse(it.hasNext());
  }

  public void testSequenceBuilding3()
  {
    final SequenceList list = new DefaultSequenceList();
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.START), new SpacerRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.START), new SpacerRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.END), new SpacerRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.END), new SpacerRenderNode());

    final ChunkIterator it = new ChunkIterator(list, 0);
    assertNext(it, 0, 3, 30);
    assertNext(it, 3, 3, 30);
    assertFalse(it.hasNext());
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.process.layoutrules.SequenceList

  }


  public void testSequenceBuilding2()
  {
    final SequenceList list = new DefaultSequenceList();
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.START), new SpacerRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.CONTENT), new DummyRenderNode());
    list.add(new TestInlineSequenceElement(InlineSequenceElement.Classification.END), new SpacerRenderNode());

    final ChunkIterator it = new ChunkIterator(list, 0);
    assertNext(it, 0, 2, 20);
    assertNext(it, 2, 1, 10);
    assertNext(it, 3, 2, 20);
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.