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

Examples of org.pentaho.reporting.engine.classic.core.layout.style.SimpleStyleSheet


  public void testStylesToArray ()
  {
    final ManualBreakIndicatorStyleSheet mbis =
        new ManualBreakIndicatorStyleSheet(BandDefaultStyleSheet.getBandDefaultStyle());
    final StyleSheet manualBreakBoxStyle = new SimpleStyleSheet(mbis);

    final int styleCount = (StyleKey.getDefinedStyleKeyCount());
    assertTrue(styleCount > 0);
    final Object[] objects = manualBreakBoxStyle.toArray();
    assertNotNull(objects);
    assertEquals(objects.length, styleCount);
  }
View Full Code Here


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

    box.close();
  }

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

      addTextNodes(element, rawValue, result.getText(), result.getFinish(),
          parentBox, result.getStyleSheet(), stateKey);
      return;
    }

    final SimpleStyleSheet elementStyle;
    if ((parentBox.getNodeType() & LayoutNodeTypes.MASK_BOX_CANVAS) == LayoutNodeTypes.MASK_BOX_CANVAS)
    {
      if (element.isDynamicContent() == false)
      {
        elementStyle = textStyleCache.getStyleSheet(new NonDynamicHeightWrapperStyleSheet(style));
View Full Code Here

  protected void processReportDrawableContent(final ReportDrawable reportDrawable,
                                              final RenderBox box,
                                              final Element element,
                                              final ReportStateKey stateKey)
  {
    final SimpleStyleSheet elementStyle;
    if (((box.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE) == false)
    {
      if (element.isDynamicContent() == false)
      {
        elementStyle = textStyleCache.getStyleSheet(new NonDynamicHeightWrapperStyleSheet(element.getStyle()));
View Full Code Here

  {
    final String anchorName = anchor.getName();

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

                                        final Object rawValue,
                                        final RenderBox box,
                                        final Element element,
                                        final ReportStateKey stateKey)
  {
    final SimpleStyleSheet elementStyle;
    if (((box.getNodeType() & LayoutNodeTypes.MASK_BOX_INLINE) == LayoutNodeTypes.MASK_BOX_INLINE) == false)
    {
      if (element.isDynamicContent() == false)
      {
        elementStyle = textStyleCache.getStyleSheet(new NonDynamicHeightWrapperStyleSheet(element.getStyle()));
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
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);
View Full Code Here

        lookupKey.setInstanceId(id);
        final CacheCarrier cc = (CacheCarrier) cache.get(lookupKey);
        if (cc == null)
        {
          final CacheKey key = new CacheKey(id, NonPaddingWrapperStyleSheet.class.getName());
          final SimpleStyleSheet styleSheet = new SimpleStyleSheet(nonPaddingWrapperStyleSheet);
          cache.put(key, new CacheCarrier(nonPaddingWrapperStyleSheet.getChangeTracker(), styleSheet));
          return styleSheet;
        }

        if (cc.getChangeTracker() != nonPaddingWrapperStyleSheet.getChangeTracker())
        {
          final CacheKey key = new CacheKey(id, NonPaddingWrapperStyleSheet.class.getName());
          final SimpleStyleSheet styleSheet = new SimpleStyleSheet(nonPaddingWrapperStyleSheet);
          cache.put(key, new CacheCarrier(nonPaddingWrapperStyleSheet.getChangeTracker(), styleSheet));
          return styleSheet;
        }

        return cc.getStyleSheet();
      }
      finally
      {
        nonPaddingWrapperStyleSheet.setParent(null);
      }
    }

    final InstanceID id = parent.getId();
    final String styleClass = parent.getClass().getName();
    lookupKey.setStyleClass(styleClass);
    lookupKey.setInstanceId(id);
    final CacheCarrier cc = (CacheCarrier) cache.get(lookupKey);
    if (cc == null)
    {
      final CacheKey key = new CacheKey(id, styleClass);
      final SimpleStyleSheet styleSheet = new SimpleStyleSheet(parent);
      cache.put(key, new CacheCarrier(parent.getChangeTracker(), styleSheet));
      return styleSheet;
    }

    if (cc.getChangeTracker() != parent.getChangeTracker())
    {
      final CacheKey key = new CacheKey(id, styleClass);
      final SimpleStyleSheet styleSheet = new SimpleStyleSheet(parent);
      cache.put(key, new CacheCarrier(parent.getChangeTracker(), styleSheet));
      return styleSheet;
    }

    return cc.getStyleSheet();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.style.SimpleStyleSheet

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.