Examples of ElementStyleSheet


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

        }
      }
    }

    final PageFooter pageFooter = report.getPageFooter();
    final ElementStyleSheet pageFooterStyle = pageFooter.getStyle();
    if (state.getCurrentPage() == 1)
    {
      if (pageFooterStyle.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE) == true)
      {
        print(getRuntime(), pageFooter);
      }
      else if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
    }
    else if (isLastPagebreak())
    {
      if (pageFooterStyle.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_LASTPAGE, false) == true)
      {
        print(getRuntime(), pageFooter);
      }
      else if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
    }
    else
    {
      if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
      else
      {
        print(getRuntime(), pageFooter);
      }
    }
    somethingSticks |= pageFooter.isSticky();

    for (int i = 0; i < levelCount; i++)
    {
      final LayouterLevel level = levels[i];
      final ReportDefinition def = level.getReportDefinition();
      final PageFooter b = def.getPageFooter();
      if (b.isSticky() == false)
      {
        if (somethingSticks)
        {
          printEmptyRootLevelBand();
        }
        continue;
      }

      somethingSticks = true;

      final ElementStyleSheet style = b.getStyle();
      if (state.getCurrentPage() == 1)
      {
        if (style.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE) == true)
        {
          print(level.getRuntime(), b);
        }
        else
        {
          printEmptyRootLevelBand();
        }
      }
      else if (isLastPagebreak())
      {
        if (style.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_LASTPAGE) == true)
        {
          print(level.getRuntime(), b);
        }
        else
        {
View Full Code Here

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

    final String[] styleNames = styles.getStyleNames();

    for (int i = 0; i < styleNames.length; i++)
    {
      final String name = styleNames[i];
      final ElementStyleSheet style = styles.getStyleSheet(name);

      StyleWriterUtility.writeStyleRule(BundleNamespaces.STYLE, "style-rule", writer, style, true);
    }

    // write layout processor section
View Full Code Here

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

    {
      final String[] classes = StringUtils.split(parent, " ", "'");
      for (int i = 0; i < classes.length; i++)
      {
        final String aClass = classes[i];
        final ElementStyleSheet parentStyleSheet = styleSheetCollection.createStyleSheet(aClass);
        try
        {
          styleSheet.addParent(parentStyleSheet);
        }
        catch (IllegalArgumentException e)
View Full Code Here

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

    {
      final String[] classes = StringUtils.split(parent, " ", "'");
      for (int i = 0; i < classes.length; i++)
      {
        final String aClass = classes[i];
        final ElementStyleSheet parentStyleSheet = styleSheetCollection.createStyleSheet(aClass);
        try
        {
          styleSheet.addParent(parentStyleSheet);
        }
        catch (IllegalArgumentException e)
View Full Code Here

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

    final Number paddingTop = (Number) maybePaddingTop;
    final Number paddingLeft = (Number) maybePaddingLeft;
    final Number paddingBottom = (Number) maybePaddingBottom;
    final Number paddingRight = (Number) maybePaddingRight;

    final ElementStyleSheet styleSheet = detailElement.getStyle();
    styleSheet.setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(paddingTop.floatValue()));
    styleSheet.setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(paddingLeft.floatValue()));
    styleSheet.setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(paddingBottom.floatValue()));
    styleSheet.setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(paddingRight.floatValue()));
  }
View Full Code Here

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

  }

  private void setupDefaultGrid(final Band band, final Element detailElement)
  {
    setupDefaultPadding(band, detailElement);
    final ElementStyleSheet styleSheet = detailElement.getStyle();
    // Always make the height of the detailElement dynamic to the band
    // According to thomas negative numbers equate to percentages
    styleSheet.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(-100));

    final Object maybeBorderStyle = band.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.GRID_STYLE);
    final Object maybeBorderWidth = band.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.GRID_WIDTH);
    final Object maybeBorderColor = band.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.GRID_COLOR);

    if (maybeBorderColor instanceof Color == false ||
        maybeBorderStyle instanceof BorderStyle == false ||
        maybeBorderWidth instanceof Number == false)
    {
      return;
    }

    final BorderStyle style = (BorderStyle) maybeBorderStyle;
    final Color color = (Color) maybeBorderColor;
    final Number number = (Number) maybeBorderWidth;
    final Float width = new Float(number.floatValue());

    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH, width);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_COLOR, color);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, style);

    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_LEFT_WIDTH, width);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_LEFT_COLOR, color);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE, style);

    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_WIDTH, width);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_COLOR, color);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, style);

    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_WIDTH, width);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_COLOR, color);
    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE, style);
  }
View Full Code Here

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

    final Element watermarkImage = new Element();
    watermarkImage.setElementType(new ContentType());
    watermarkImage.setAttribute
        (AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, watermarkDefinition.getSource());
    final ElementStyleSheet watermarkStyle = watermarkImage.getStyle();
    watermarkStyle.setStyleProperty(ElementStyleKeys.POS_X, convertLength(watermarkDefinition.getX()));
    watermarkStyle.setStyleProperty(ElementStyleKeys.POS_Y, convertLength(watermarkDefinition.getY()));
    watermarkStyle.setStyleProperty(ElementStyleKeys.MIN_WIDTH, convertLength(watermarkDefinition.getWidth()));
    watermarkStyle.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, convertLength(watermarkDefinition.getHeight()));
    watermarkStyle.setStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO, watermarkDefinition.getKeepAspectRatio());
    watermarkStyle.setStyleProperty(ElementStyleKeys.SCALE, watermarkDefinition.getScale());

    content.addElement(watermarkImage);
  }
View Full Code Here

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

  }

  public void testReport () throws Exception
  {
    final MasterReport report = new MasterReport();
    final ElementStyleSheet es = report.getStyleSheetCollection().createStyleSheet("test");
    es.setStyleProperty(ElementStyleKeys.HREF_TITLE, "Hello World!");
    report.getReportHeader().getStyle().addParent(es);
    assertEquals(report.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

    final ReportDefinition rd = new ReportDefinitionImpl(report, report.getPageDefinition());
    assertEquals(rd.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

    // redefining the outside stylesheet must not change the stylesheet
    // inside the report definition.
    // check for deep-cloning!
    es.setStyleProperty(ElementStyleKeys.HREF_TITLE, "Hello Little Green Man!");
    assertSame(rd.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

  }
View Full Code Here

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

   *
   * @param band the item band to be configured.
   */
  private static void configureItemBand(final ItemBand band)
  {
    final ElementStyleSheet ess = band.getStyle();
    ess.setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    ess.setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(9));

    TextFieldElementFactory factory = new TextFieldElementFactory();
    factory.setName("Name_Field");
    factory.setAbsolutePosition(new Point2D.Float(0, 2));
    factory.setMinimumSize(new FloatDimension(140, 10));
View Full Code Here

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

   */
  private static void configurePageFooter(final PageFooter footer)
  {
    footer.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(20));

    final ElementStyleSheet ess = footer.getStyle();
    ess.setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    ess.setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(9));

    final NumberFieldElementFactory factory = new NumberFieldElementFactory();
    factory.setName("PageNumber_Field");
    factory.setAbsolutePosition(new Point2D.Float(0, 0));
    factory.setMinimumSize(new Dimension(-100, -100));
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.