Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.FastStack


      throw new NullPointerException();
    }

    this.reportContext = reportContext;
    this.exportDescriptor = reportContext.getExportDescriptor();
    this.expressionsStack = new FastStack(10);
    this.dataContextStack = new FastStack(10);
    this.advanceRequested = false;
    this.parameters = parameters;

    this.dataRow = GlobalMasterRow.createReportRow
        (reportContext, schemaDefinition, new ParameterDataRow(parameters), parameterDefinitionEntries, includeStructuralPreprocessing);
View Full Code Here



  private BoxAlignContext createVerticalAlignContext(final InlineRenderBox box)
  {
    BoxAlignContext alignContext = new BoxAlignContext(box);
    final FastStack contextStack = new FastStack(50);
    final FastStack alignContextStack = new FastStack(50);
    RenderNode next = box.getFirstChild();
    RenderBox context = box;

    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);
          alignContextStack.push(alignContext);

          next = firstChild;

          final BoxAlignContext childBoxContext = new BoxAlignContext(nBox);
          alignContext.addChild(childBoxContext);
          context = nBox;
          alignContext = childBoxContext;
        }
        else
        {
          // Process an empty box.
          final BoxAlignContext childBoxContext = new BoxAlignContext(nBox);
          alignContext.addChild(childBoxContext);
          next = nBox.getNext();
        }
      }
      else
      {
        // Process an ordinary node.
        if (next.getNodeType() == LayoutNodeTypes.TYPE_NODE_TEXT)
        {
          alignContext.addChild(new TextElementAlignContext((RenderableText) next));
        }
        else if (next.getNodeType() == LayoutNodeTypes.TYPE_BOX_CONTENT)
        {
          alignContext.addChild(new ReplacedContentAlignContext((RenderableReplacedContentBox) next, 0));
        }
        else if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX_BLOCK) == LayoutNodeTypes.MASK_BOX_BLOCK)
        {
          alignContext.addChild(new InlineBlockAlignContext((RenderBox) next));
        }
        else
        {
          alignContext.addChild(new NodeAlignContext(next));
        }
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
        // Finish the current box context, if needed
        next = context.getNext();
        context = (RenderBox) contextStack.pop();
        alignContext.validate();
        alignContext = (BoxAlignContext) alignContextStack.pop();
      }
    }
    return alignContext;
  }
View Full Code Here

    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

    }

    boolean needToAddSpacing = true;

    // do the merging ..
    final FastStack contextStack = new FastStack(50);
    RenderNode next = nextBox.getFirstChild();
    MergeContext context = new MergeContext(lineBox, nextBox);
    while (next != null)
    {
      // process next
      final RenderBox writeContext = context.getWriteContext();
      final StaticBoxLayoutProperties staticBoxLayoutProperties = writeContext.getStaticBoxLayoutProperties();
      long spaceWidth = staticBoxLayoutProperties.getSpaceWidth();
      if (spaceWidth == 0)
      {
        // Space has not been computed yet.
        final FontMetrics fontMetrics = metaData.getFontMetrics(writeContext.getStyleSheet());
        spaceWidth = fontMetrics.getCharWidth(' ');
        staticBoxLayoutProperties.setSpaceWidth(spaceWidth);
      }

      if ((next.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX)
      {
        final RenderBox nBox = (RenderBox) next;
        final RenderNode firstChild = nBox.getFirstChild();
        if (firstChild != null)
        {
          contextStack.push(context);
          next = firstChild;

          final RenderNode writeContextLastChild = writeContext.getLastChild();
          if ((writeContextLastChild.getNodeType() & LayoutNodeTypes.MASK_BOX) == LayoutNodeTypes.MASK_BOX)
          {
            if (writeContextLastChild.getInstanceId() == nBox.getInstanceId())
            {
              context = new MergeContext((RenderBox) writeContextLastChild, nBox);
            }
            else
            {
              if (needToAddSpacing)
              {
                if (spaceWidth > 0)
                {
                  // docmark: Used zero as new height
                  final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
                  spacer.setVirtualNode(true);
                  writeContext.addGeneratedChild(spacer);
                }
                needToAddSpacing = false;
              }
              final RenderBox newWriter = (RenderBox) nBox.derive(false);
              newWriter.setVirtualNode(true);
              writeContext.addGeneratedChild(newWriter);
              context = new MergeContext(newWriter, nBox);
            }
          }
          else
          {
            if (needToAddSpacing)
            {
              if (spaceWidth > 0)
              {
                // docmark: Used zero as new height
                final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
                spacer.setVirtualNode(true);
                writeContext.addGeneratedChild(spacer);
              }
              needToAddSpacing = false;
            }

            final RenderBox newWriter = (RenderBox) nBox.derive(false);
            newWriter.setVirtualNode(true);
            writeContext.addGeneratedChild(newWriter);
            context = new MergeContext(newWriter, nBox);
          }
        }
        else
        {
          if (needToAddSpacing)
          {
            if (spaceWidth > 0)
            {
              // docmark: Used zero as new height
              final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
              spacer.setVirtualNode(true);
              writeContext.addGeneratedChild(spacer);
            }
            needToAddSpacing = false;
          }

          final RenderNode box = nBox.derive(true);
          box.setVirtualNode(true);
          writeContext.addGeneratedChild(box);
          next = nBox.getNext();
        }
      }
      else
      {
        if (needToAddSpacing)
        {
          final RenderNode lastChild = writeContext.getLastChild();
          if (spaceWidth > 0 && lastChild != null &&
              (lastChild.getNodeType() != LayoutNodeTypes.TYPE_NODE_SPACER))
          {
            // docmark: Used zero as new height
            final SpacerRenderNode spacer = new SpacerRenderNode(spaceWidth, 0, false, 1);
            spacer.setVirtualNode(true);
            writeContext.addGeneratedChild(spacer);
          }
          needToAddSpacing = false;
        }

        final RenderNode child = next.derive(true);
        child.setVirtualNode(true);
        writeContext.addGeneratedChild(child);
        next = next.getNext();
      }

      while (next == null && contextStack.isEmpty() == false)
      {
//        Log.debug ("FINISH " + context.getReadContext());
        next = context.getReadContext().getNext();
        context = (MergeContext) contextStack.pop();
      }
    }

    return rebuildLastLine(lineBox, (ParagraphPoolBox) nextBox.getNext());
  }
View Full Code Here

  private boolean overflowX;


  protected AbstractAlignmentProcessor()
  {
    this.contexts = new FastStack(50);
    this.pendingElements = new ArrayList();
    this.elementDimensions = AbstractAlignmentProcessor.EMPTY;
    this.elementPositions = AbstractAlignmentProcessor.EMPTY;
  }
View Full Code Here

  private ReportStateKey lastSeenStateKey;

  public CleanFlowBoxesStep()
  {
    finishContexts = new HashMap();
    blockContexts = new FastStack(50);
  }
View Full Code Here

  private ParagraphLinebreaker breakState;
  private SimpleLinebreaker reusableSimpleLinebreaker;

  public ParagraphLineBreakStep()
  {
    paragraphNesting = new FastStack(50);
  }
View Full Code Here

    {
      throw new NullPointerException();
    }

    this.contentGenerator = contentGenerator;
    this.processStack = new FastStack();
    this.metaData = metaData;
    this.xmlWriter = xmlWriter;
    this.styleManager = styleManager;
    this.styleBuilder = new StyleBuilder();
    this.characterEntityParser = HtmlCharacterEntities.getEntityParser();
View Full Code Here

   */
  public DefaultOutputFunction()
  {
    this.pagebreakHandler = new DefaultLayoutPagebreakHandler();
    this.inlineSubreports = new ArrayList<InlineSubreportMarker>();
    this.outputHandlers = new FastStack();
    this.crosstabLayouts = new FastStack();
  }
View Full Code Here

  public RTFTextExtractor(final RTFOutputProcessorMetaData metaData)
  {
    super(metaData);
    this.metaData = metaData;
    this.handleImages = metaData.isFeatureSupported(RTFOutputProcessorMetaData.IMAGES_ENABLED);
    context = new FastStack(50);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.FastStack

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.