Examples of ElementStyleSheet


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

          final String name = attributeNames[j];
          setAttributeExpression(namespace, name, report.getAttributeExpression(namespace, name));
        }
      }

      final ElementStyleSheet styleSheet = report.getStyle();
      final StyleKey[] styleKeys = styleSheet.getPropertyKeys();
      for (int i = 0; i < styleKeys.length; i++)
      {
        final StyleKey styleKey = styleKeys[i];
        if (styleKey != null)
        {
          getStyle().setStyleProperty(styleKey, styleSheet.getStyleProperty(styleKey));
        }
      }
    }
    catch (final CloneNotSupportedException cne)
    {
View Full Code Here

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

    {
      final AutoGeneratorFieldDescription fieldDescription = fieldDescriptions[i];
      if (header != null)
      {
        final Element headerElement = AutoGeneratorUtility.generateHeaderElement(fieldDescription.getFieldName());
        final ElementStyleSheet headerStyle = headerElement.getStyle();
        headerStyle.setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(widths[i]));
        header.addElement(headerElement);
      }

      if (details != null)
      {
        final Element detailsElement = AutoGeneratorUtility.generateDetailsElement(fieldDescription.getFieldName(),
            fieldDescription.getTargetType());
        if (Boolean.TRUE.equals(fieldDescription.getHideDuplicateValues()))
        {
          detailsElement.setAttribute
              (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ONLY_SHOW_CHANGING_VALUES, Boolean.TRUE);
        }

        final ElementStyleSheet detailsStyle = detailsElement.getStyle();
        detailsStyle.setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(widths[i]));
        details.addElement(detailsElement);
      }
    }
  }
View Full Code Here

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

  public void testSimpleClone ()
          throws CloneNotSupportedException
  {
    final StyleSheetCollection sc = new StyleSheetCollection();
    final ElementStyleSheet es1 = sc.createStyleSheet("one");
    final ElementStyleSheet es2 = sc.createStyleSheet("two");
    final ElementStyleSheet es3 = sc.createStyleSheet("three");
    final ElementStyleSheet es4 = sc.createStyleSheet("four");

    es1.addParent(es2);
    es1.addParent(es4);

    es2.addParent(es3);
    es3.addParent(es4);

    try
    {
      es4.addParent(es1);
      fail("Loop not detected");
    }
    catch(Exception e)
    {

    }

    final StyleSheetCollection scc = (StyleSheetCollection) sc.clone();
    final ElementStyleSheet esc1 = scc.getStyleSheet("one");
    final ElementStyleSheet esc2 = scc.getStyleSheet("two");
    final ElementStyleSheet esc3 = scc.getStyleSheet("three");
    final ElementStyleSheet esc4 = scc.getStyleSheet("four");

    assertEquals(es1.getId(), esc1.getId());
    assertEquals(es2.getId(), esc2.getId());
    assertEquals(es3.getId(), esc3.getId());
    assertEquals(es4.getId(), esc4.getId());

    final List parents = Arrays.asList(esc1.getParents());
    assertTrue(parents.contains(esc2));
    assertTrue(parents.contains(esc4));
    assertFalse(parents.contains(es2));
View Full Code Here

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

  }

  private void configurePageHeader()
  {
    final PageHeader pageHeader = report.getPageHeader();
    final ElementStyleSheet style = pageHeader.getStyle();
    style.setStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE, Boolean.TRUE);
    style.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(24));
    style.setStyleProperty(TextStyleKeys.FONT, "Serif");
    style.setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));
    style.setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(0xAFAFAF));


    pageHeader.addElement
        (HorizontalLineElementFactory.createHorizontalLine
            (18, null, new BasicStroke(1)));
View Full Code Here

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

  public void testForeignStyles ()
          throws CloneNotSupportedException
  {
    final StyleSheetCollection sc = new StyleSheetCollection();
    final ElementStyleSheet es1 = sc.createStyleSheet("one");
    final ElementStyleSheet es2 = sc.createStyleSheet("two");

    es1.addParent(es2);

    final StyleSheetCollection scc = (StyleSheetCollection) sc.clone();
    final ElementStyleSheet esc1 = scc.getStyleSheet("one");
    final ElementStyleSheet esc2 = scc.getStyleSheet("two");
    final List parents = Arrays.asList(esc1.getParents());
    assertTrue(parents.contains(esc2));
  }
View Full Code Here

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

  }

  private void configurePageFooter()
  {
    final PageFooter pageFooter = report.getPageFooter();
    final ElementStyleSheet style = pageFooter.getStyle();
    style.setStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE, Boolean.TRUE);
    style.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(24));
    style.setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(0xAFAFAF));
    pageFooter.addElement
        (HorizontalLineElementFactory.createHorizontalLine
            (0, null, new BasicStroke(1)));

    final TextFieldElementFactory elementFactory = new TextFieldElementFactory();
View Full Code Here

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

    try
    {
      MasterReport report = generator.parseReport(in);
      final StyleSheetCollection styleCollection =
          report.getStyleSheetCollection();
      final ElementStyleSheet styleSheet =
          styleCollection.createStyleSheet("my-style");
      styleSheet.setStyleProperty(TextStyleKeys.FONT, "SansSerif");
      styleSheet.setStyleProperty(ElementStyleKeys.PAINT, Color.blue);

      report.setDataFactory(new TableDataFactory("default", data));
      return report;
    }
    catch (IOException e)
View Full Code Here

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

  public static Band convertToBand(final StyleKey[] definedStyleKeys,
                                    final Element element, final Element child)
  {
    final Band b = new Band(element.getObjectID());
    final ElementStyleSheet targetStyle = b.getStyle();
    final ElementStyleSheet sourceStyle = element.getStyle();
    for (int i = 0; i < definedStyleKeys.length; i++)
    {
      // copy all, even the inherited styles, as we do not add the element/band to the real parent. All we do
      // is virtual ..
      final StyleKey key = definedStyleKeys[i];
      targetStyle.setStyleProperty(key, sourceStyle.getStyleProperty(key));
    }

    final String[] attrNs = element.getAttributeNamespaces();
    for (int i = 0; i < attrNs.length; i++)
    {
View Full Code Here

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

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

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

    return element.getElementType().getValue(runtime, element);
  }

  protected boolean isControlBand(final Band band)
  {
    final ElementStyleSheet style = band.getStyle();
    if (style.getStyleProperty(BandStyleKeys.COMPUTED_SHEETNAME) != null)
    {
      return true;
    }
    if (style.getStyleProperty(BandStyleKeys.BOOKMARK) != null)
    {
      return true;
    }
    if ("inline".equals(style.getStyleProperty(BandStyleKeys.LAYOUT)) == false)
    {
      if (Boolean.TRUE.equals(style.getStyleProperty(BandStyleKeys.PAGEBREAK_AFTER)))
      {
        return true;
      }
      if (Boolean.TRUE.equals(style.getStyleProperty(BandStyleKeys.PAGEBREAK_BEFORE)))
      {
        return true;
      }
    }
    return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.