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

Examples of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition


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


  }

  private void ensureEmptyChildIsAdded(final RenderBox parent, final Element element, final ReportStateKey stateKey)
  {
    final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(element.getStyle());
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);

    final int parentNodeType = parent.getNodeType();
    final boolean parentIsInlineContainer =
        ((parentNodeType & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE ||
            (parentNodeType == LayoutNodeTypes.TYPE_BOX_PARAGRAPH));
View Full Code Here

    {
      wrapper = new DrawableWrapper(reportDrawable);
    }

    final RenderableReplacedContent content = new RenderableReplacedContent(elementStyle, wrapper, null, metaData);
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(elementStyle);
    final RenderableReplacedContentBox child =
        new RenderableReplacedContentBox(elementStyle, element.getObjectID(), boxDefinition,
            element.getElementType(), element.getAttributes(), stateKey, content);
    child.setName(element.getName());
    box.addChild(child);
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();
View Full Code Here

    {
      rawKey = null;
    }

    final RenderableReplacedContent content = new RenderableReplacedContent(elementStyle, value, rawKey, metaData);
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(elementStyle);
    final RenderableReplacedContentBox child =
        new RenderableReplacedContentBox(elementStyle, element.getObjectID(), boxDefinition,
            element.getElementType(), element.getAttributes(), stateKey, content);
    child.setName(element.getName());
    box.addChild(child);
View Full Code Here

  {
    final StyleKey styleKey = ElementStyleKeys.PADDING_LEFT;
    if ((parentBox.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE)
    {
      final StyleSheet styleSheet = bandCache.getStyleSheet(elementStyle);
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      final InlineRenderBox autoParagraphBox =
          new InlineRenderBox(styleSheet, element.getObjectID(), boxDefinition,
              element.getElementType(), element.getAttributes(), stateKey);
      autoParagraphBox.setName(element.getName());
      autoParagraphBox.getBoxDefinition().setPreferredWidth(RenderLength.AUTO);
      autoParagraphBox.addChilds(renderNodes);
      autoParagraphBox.addChilds(finishNodes);
      autoParagraphBox.close();
      final Object property = styleSheet.getStyleProperty(styleKey);
      parentBox.addChild(autoParagraphBox);
    }
    else
    {
      final StyleSheet styleSheet = bandCache.getStyleSheet(elementStyle);
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      final ParagraphRenderBox autoParagraphBox = new ParagraphRenderBox
          (styleSheet, element.getObjectID(), boxDefinition, element.getElementType(), element.getAttributes(),
              stateKey);
      autoParagraphBox.setRawValue(rawValue);
      autoParagraphBox.setName(element.getName());
View Full Code Here

    // todo: Check for cachability ..
    final RenderBox box;
    if ("block".equals(layoutType))
    {
      final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      box = new BlockRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
          band.getAttributes(), stateKey);
    }
    else if ("inline".equals(layoutType))
    {
      if (parentIsInlineBox)
      {
        final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
        final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
        box = new InlineRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
            band.getAttributes(), stateKey);
      }
      else
      {
        // The non-inheritable styles will be applied to the auto-generated paragraph box. The inlinebox itself
        // only receives the inheritable styles so that it can inherit it to its next child ..
        final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(new ParagraphPoolboxStyleSheet(elementStyleSheet));
        final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
        box = new InlineRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
            band.getAttributes(), stateKey);
      }
    }
    else if ("row".equals(layoutType))
    {
      final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      box = new RowRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
          band.getAttributes(), stateKey);
    }
    else // assume 'Canvas' by default ..
    {
      final SimpleStyleSheet styleSheet;
      if (elementStyleSheet.getBooleanStyleProperty(ElementStyleKeys.USE_MIN_CHUNKWIDTH))
      {
        styleSheet = bandCache.getStyleSheet(elementStyleSheet);
      }
      else
      {
        styleSheet = bandCache.getStyleSheet(new CanvasMinWidthStyleSheet(elementStyleSheet));
      }
      final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
      box = new CanvasRenderBox(styleSheet, band.getObjectID(), boxDefinition, band.getElementType(),
          band.getAttributes(), stateKey);
    }

    // for the sake of debugging ..
View Full Code Here

  private RenderBox produceSubreportBox(final SubReport report,
                                        final ReportStateKey stateKey)
  {
    final ElementStyleSheet elementStyleSheet = report.getStyle();
    final SimpleStyleSheet styleSheet = bandCache.getStyleSheet(elementStyleSheet);
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(styleSheet);
    final RenderBox box = new ContentPlaceholderRenderBox(styleSheet, report.getObjectID(), boxDefinition,
        report.getElementType(), report.getAttributes(), stateKey, report.getObjectID());
    box.getStaticBoxLayoutProperties().setPlaceholderBox(true);

    // for the sake of debugging ..
View Full Code Here

  private SectionRenderBox[] sectionBoxes;
  private LayoutResult lastValidateResult;

  protected AbstractRenderer(final OutputProcessor outputProcessor)
  {
    final BoxDefinition boxDefinition = new BoxDefinition();
    boxDefinition.setPreferredHeight(new RenderLength(100000, true));
    this.watermarkBoxDefinition = boxDefinition.lock();

    this.outputProcessor = outputProcessor;
    this.metaData = outputProcessor.getMetaData();
    this.normalFlowLayoutBuilder = createNormalFlowLayoutBuilder(metaData);
    this.headerLayoutBuilder = new SlottedLayoutBuilder(metaData, false);
View Full Code Here

    {
      throw new IllegalStateException();
    }

    final SimpleStyleSheet reportStyle = sectionStyleCache.getStyleSheet(report.getStyle());
    final BoxDefinition boxDefinition = boxDefinitionFactory.getBoxDefinition(reportStyle);
    this.pageBox = new LogicalPageBox(report, reportStyle, boxDefinition);

    if (reportStyle.getBooleanStyleProperty(ElementStyleKeys.AVOID_PAGEBREAK_INSIDE))
    {
      this.groupStack.push(new GroupSection(pageBox.getContentArea(), bandWithKeepTogetherStyle));
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.model.context.BoxDefinition

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.