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

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


  private PageableBreakContext getBreakContext(final RenderBox box,
                                               final boolean createBoxIfNeeded,
                                               final boolean useInitialShift)
  {
    final Object boxContext = box.getBreakContext();
    final RenderBox parentBox = box.getParent();
    if (boxContext instanceof PageableBreakContext)
    {
      final PageableBreakContext context = (PageableBreakContext) boxContext;
      if (createBoxIfNeeded)
      {
View Full Code Here


          if ((lastChild.getNodeType() & LayoutNodeTypes.MASK_BOX) != LayoutNodeTypes.MASK_BOX)
          {
            lastChild = lastChild.getPrev();
            continue;
          }
          final RenderBox lastBox = (RenderBox) lastChild;
          if (updateStateKeyDeep(lastBox))
          {
            return true;
          }
          lastChild = lastBox.getPrev();
        }
        return false;
      }
    }
    else
View Full Code Here

    final PageableBreakContext context = getBreakContext(box, false, false);
    if (breakPending == false && box.isBreakAfter())
    {
      breakPending = (true);
    }
    final RenderBox parentBox = box.getParent();
    if (parentBox == null)
    {
      return;
    }
    final PageableBreakContext parentContext = getBreakContext(parentBox, false, false);
View Full Code Here

  }

  protected void finishInlineLevelBox(final RenderBox box)
  {
    final PageableBreakContext context = getBreakContext(box, false, false);
    final RenderBox parentBox = box.getParent();
    if (parentBox == null)
    {
      return;
    }
    final PageableBreakContext parentContext = getBreakContext(parentBox, false, false);
View Full Code Here

  }

  protected void finishCanvasLevelBox(final RenderBox box)
  {
    final PageableBreakContext context = getBreakContext(box, false, false);
    final RenderBox parentBox = box.getParent();
    if (parentBox == null)
    {
      return;
    }
    final PageableBreakContext parentContext = getBreakContext(parentBox, false, false);
View Full Code Here

  }

  protected void finishRowLevelBox(final RenderBox box)
  {
    final PageableBreakContext context = getBreakContext(box, false, false);
    final RenderBox parentBox = box.getParent();
    if (parentBox == null)
    {
      return;
    }
    final PageableBreakContext parentContext = getBreakContext(parentBox, false, false);
View Full Code Here

        {
          final int parentNodeType = parent.getNodeType();
          final boolean parentIsInlineContainer =
              ((parentNodeType & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE ||
                  (parentNodeType == LayoutNodeTypes.TYPE_BOX_PARAGRAPH));
          final RenderBox box = produceBox(band, stateKey, parentIsInlineContainer);
          parent.addChild(box);
          box.getStaticBoxLayoutProperties().setPlaceholderBox(true);
          box.close();
        }
        else if (band instanceof RootLevelBand)
        {
          addEmptyRootLevelBand(parent, stateKey);
        }
        else
        {
          // if parent is row, then add empty band.
          ensureEmptyChildIsAdded(parent, band, stateKey);
        }
        return;
      }
    }

    final int parentNodeType = parent.getNodeType();
    final boolean parentIsInlineContainer =
        ((parentNodeType & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE ||
            (parentNodeType == LayoutNodeTypes.TYPE_BOX_PARAGRAPH));
    final RenderBox box = produceBox(band, stateKey, parentIsInlineContainer);
    ParagraphRenderBox paragraphBox = null;
    if (((box.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE) &&
        parentIsInlineContainer == false)
    {
      // Normalize the rendering-model. Inline-Boxes must always be contained in Paragraph-Boxes ..
      final ElementStyleSheet bandStyle = band.getStyle();
      final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(bandStyle);
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      paragraphBox = new ParagraphRenderBox
          (styleSheet, band.getObjectID(), boxDefinition, box.getElementType(), box.getAttributes(), stateKey);
      paragraphBox.setName(band.getName());
      paragraphBox.getBoxDefinition().setPreferredWidth(RenderLength.AUTO);
      paragraphBox.addChild(box);

      parent.addChild(paragraphBox);
    }
    else
    {
      parent.addChild(box);
    }

    final boolean invConsSpace = box.getStyleSheet().getBooleanStyleProperty
        (ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, box.getNodeType() == LayoutNodeTypes.TYPE_BOX_ROWBOX);

    final Element[] elementBuffer = band.unsafeGetElementArray();
    final int elementCount = band.getElementCount();
    for (int i = 0; i < elementCount; i++)
    {
      final Element element = elementBuffer[i];
      if (element.isVisible() == false && invConsSpace == false)
      {
        continue;
      }

      if (element instanceof Band)
      {
        final Band childBand = (Band) element;
        add(box, childBand, runtime, stateKey);
        continue;
      }

      if (element instanceof SubReport)
      {
        performAddInlineSubReport(runtime, stateKey, box, (SubReport) element);
        continue;
      }

      final Object value = computeValue(runtime, element);
      if (value instanceof Element)
      {
        final Band b = RichTextConverterUtilities.convertToBand(definedStyleKeys, element, (Element) value);
        add(box, b, runtime, stateKey);
      }
      else
      {
        performRenderValue(runtime, stateKey, box, element, value);
      }

      // if value instanceof element, then treat the element as band, and the value as sub-element to the band.
    }

    if (paragraphBox != null)
    {
      paragraphBox.close();
    }

    box.close();
  }
View Full Code Here

    final int parentNodeType = parent.getNodeType();
    final boolean parentIsInlineContainer =
        ((parentNodeType & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE ||
            (parentNodeType == LayoutNodeTypes.TYPE_BOX_PARAGRAPH));
    final RenderBox box;
    if (parentIsInlineContainer)
    {
      box = new InlineRenderBox(styleSheet, element.getObjectID(), boxDefinition, element.getElementType(),
          element.getAttributes(), stateKey);
    }
    else
    {
      box = new BlockRenderBox(styleSheet, element.getObjectID(), boxDefinition, element.getElementType(),
          element.getAttributes(), stateKey);
    }
    box.getStaticBoxLayoutProperties().setPlaceholderBox(true);
    box.close();
    parent.addChild(box);
  }
View Full Code Here

    {
      logger.warn("Not adding subreport: Subreports in inline-contexts are not supported.");
      return;
    }

    final RenderBox subreportbox = produceSubreportBox(element, stateKey);
    box.addChild(subreportbox);
    // the box will be closed
    collectedReports.add(new InlineSubreportMarker(element, subreportbox.getInstanceId(), SubReportProcessType.INLINE));
  }
View Full Code Here

    if ((box.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
    {
      final SimpleStyleSheet styleSheet = bandCache.getStyleSheet
          (new NonDynamicHeightWrapperStyleSheet(new AnchorStyleSheet(anchorName, element.getStyle())));
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      final RenderBox autoParagraphBox = new InlineRenderBox(styleSheet, element.getObjectID(), boxDefinition,
          element.getElementType(), element.getAttributes(), stateKey);
      autoParagraphBox.setName(element.getName());
      autoParagraphBox.getBoxDefinition().setPreferredWidth(RenderLength.AUTO);
      autoParagraphBox.close();
      box.addChild(autoParagraphBox);
    }
    else // add the replaced content into a ordinary block box. There's no need to create a full paragraph for it
    {
      final SimpleStyleSheet styleSheet = bandCache.getStyleSheet
          (new NonDynamicHeightWrapperStyleSheet(new AnchorStyleSheet(anchorName, element.getStyle())));
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      final RenderBox autoParagraphBox = new CanvasRenderBox(styleSheet, element.getObjectID(), boxDefinition,
          element.getElementType(), element.getAttributes(), stateKey);
      autoParagraphBox.setName(element.getName());
      autoParagraphBox.getBoxDefinition().setPreferredWidth(RenderLength.AUTO);
      autoParagraphBox.close();
      box.addChild(autoParagraphBox);
    }
  }
View Full Code Here

TOP

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