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

Examples of org.pentaho.reporting.engine.classic.core.style.StyleSheet


    return renderer.getPageCount() + 1;
  }

  private boolean isPageHeaderPrinting(final Band b, final boolean testSticky)
  {
    final StyleSheet resolverStyleSheet = b.getComputedStyle();
    if (resolverStyleSheet == null)
    {
      throw new InvalidReportStateException("Inv");
    }
    if (isDesignTime()) {
      return true;
    }

    if (testSticky && resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.STICKY) == false)
    {
      return false;
    }

    final boolean displayOnFirstPage = resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE);
    if (computeCurrentPage() == 1 && displayOnFirstPage == false)
    {
      return false;
    }

    final boolean displayOnLastPage = resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_LASTPAGE);
    if (isLastPagebreak() && (displayOnLastPage == false))
    {
      return false;
    }
View Full Code Here


  public static boolean isGroupSectionPrintable(final Band b,
                                                final boolean testSticky,
                                                final boolean testRepeat)
  {
    final StyleSheet resolverStyleSheet = b.getComputedStyle();
    if (testSticky && resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.STICKY) == false)
    {
      return false;
    }

    if (testRepeat && resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.REPEAT_HEADER) == false)
    {
      return false;
    }
    return true;
  }
View Full Code Here

  }

  protected boolean isPageFooterPrintable(final Band b,
                                          final boolean testSticky)
  {
    final StyleSheet resolverStyleSheet = b.getComputedStyle();
    if (testSticky && resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.STICKY) == false)
    {
      return false;
    }

    if (computeCurrentPage() == 1)
    {
      if (resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE) == true)
      {
        return true;
      }
      else
      {
        return false;
      }
    }
    else if (isLastPagebreak())
    {
      if (resolverStyleSheet.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_LASTPAGE) == true)
      {
        return true;
      }
      else
      {
View Full Code Here

    final TextDocumentWriter writer = new TextDocumentWriter(metaData, pc, "ISO-8859-1");
    writer.open();
    writer.processPhysicalPage(pageBox.getPageGrid(), pageBox, 0, 0, null);
    writer.close();

    final StyleSheet style = pageBox.getStyleSheet();
    final String ellipse = (String)style.getStyleProperty(TextStyleKeys.RESERVED_LITERAL, null);
    final String truncatedString = out.toString("ISO-8859-1").trim().replaceAll("[\\t\\n\\r|(  )+]+", " ");
    assertTrue(truncatedString.startsWith("Customer"));
    assertTrue(truncatedString.endsWith("slight " + ellipse));
  }
View Full Code Here

    this.stateKey = stateKey;
  }

  public InstanceID startBox(final ReportElement element)
  {
    final StyleSheet computedStyle = element.getComputedStyle();
    final String layout = (String) computedStyle.getStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_CANVAS);
    return startBox(element, computedStyle, layout, false);
  }
View Full Code Here

    this.textProducer.startText();
  }

  public void startSection(final ReportElement element, final int sectionSize)
  {
    final StyleSheet resolverStyleSheet = element.getComputedStyle();
    final String layoutMode;
    final boolean legacyMode = metaData.isFeatureSupported(OutputProcessorFeature.STRICT_COMPATIBILITY);
    if (legacyMode)
    {
      layoutMode = BandStyleKeys.LAYOUT_BLOCK;
    }
    else
    {
      String layout = (String) resolverStyleSheet.getStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_AUTO);
      if (BandStyleKeys.LAYOUT_INLINE.equals(layout) &&
          !this.context.getRenderBox().isAcceptInlineBoxes()) {
        layoutMode = BandStyleKeys.LAYOUT_BLOCK;
      }
      else {
View Full Code Here

    return box.isEmptyNodesHaveSignificance();
  }

  private void ensureEmptyChildIsAdded(final RenderBox parent, final ReportElement element)
  {
    final StyleSheet resolverStyleSheet = element.getComputedStyle();
    final RenderBox box;
    if (parent.isAcceptInlineBoxes())
    {
      box = renderNodeFactory.produceRenderBox(element, resolverStyleSheet, BandStyleKeys.LAYOUT_INLINE, getStateKey());
    }
View Full Code Here

                             final Object computedValue,
                             final Object rawValue)
  {
    if (computedValue == null)
    {
      final StyleSheet resolvedStyle = element.getComputedStyle();
      final RenderBox parentRenderBox = this.context.getRenderBox();
      if (parentRenderBox.isEmptyNodesHaveSignificance() ||
          metaData.isExtraContentElement(resolvedStyle, element.getAttributes()))
      {
        ensureEmptyChildIsAdded(parentRenderBox, element);
        this.context.setEmpty(false);
      }
      return;
    }

    if (String.class.equals(computedValue.getClass()))
    {
      processText(element, (String) computedValue, rawValue);
    }
    else if (computedValue instanceof Shape)
    {
      final StyleSheet resolvedStyle = element.getComputedStyle();
      final Shape shape = (Shape) computedValue;
      final ReportDrawable reportDrawable = new ShapeDrawable
          (shape, resolvedStyle.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO));
      processReportDrawable(element, reportDrawable, rawValue);
    }
    else if (computedValue instanceof ReportDrawable)
    {
      processReportDrawable(element, (ReportDrawable) computedValue, rawValue);
View Full Code Here

      computedValue = computedValue.trim();
    }

    if (this.context.getRenderBox().isAcceptInlineBoxes() == false)
    {
      final StyleSheet elementStyle;
      final int parentNodeType = this.context.getRenderBox().getLayoutNodeType();
      if (strictLegacyMode && (parentNodeType & LayoutNodeTypes.MASK_BOX_CANVAS) == LayoutNodeTypes.MASK_BOX_CANVAS)
      {
        // A table always claims all elements as dynamic. Use the max-height to limit the expansion of elements.
        if (isTableContext(this.context.getRenderBox()) == false &&
            resolverStyleSheet.getBooleanStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT) == false)
        {
          elementStyle = new NonDynamicHeightWrapperStyleSheet(resolverStyleSheet);
        }
        else
        {
          elementStyle = new DynamicHeightWrapperStyleSheet(resolverStyleSheet);
        }
      }
      else
      {
        elementStyle = resolverStyleSheet;
      }

      this.textProducer.startText();

      final RenderBox renderBox = renderNodeFactory.createAutoParagraph(element, elementStyle, stateKey);
      final RenderNode[] renderNodes = textProducer.getRenderNodes(element, elementStyle, computedValue);
      renderBox.addChilds(renderNodes);
      renderBox.setRawValue(rawValue);

      this.context = new DefaultLayoutModelBuilderContext(this.context, renderBox);
      this.context.setEmpty(renderNodes.length == 0 && isEmptyElement(element, resolverStyleSheet, metaData));
      this.context = this.context.close();
    }
    else
    {
      final StyleSheet safeElementStyle = renderNodeFactory.createStyle(resolverStyleSheet);
      final RenderBox renderBox = renderNodeFactory.produceRenderBox(element, resolverStyleSheet, BandStyleKeys.LAYOUT_INLINE, stateKey);
      final RenderNode[] renderNodes = textProducer.getRenderNodes(element, safeElementStyle, computedValue);
      renderBox.addChilds(renderNodes);
      renderBox.setRawValue(rawValue);
View Full Code Here

                                        final Object rawValue)
  {
    final RenderBox box = this.context.getRenderBox();
    final SimpleStyleSheet resolverStyleSheet = element.getComputedStyle();

    final StyleSheet elementStyle;
    if (box.isAcceptInlineBoxes() == false)
    {
      if (isTableContext(box) == false &&
          resolverStyleSheet.getBooleanStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT) == false)
      {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.style.StyleSheet

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.