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

Examples of org.pentaho.reporting.engine.classic.core.Band


    configureFunctions();
  }

  private void configureRecordGroup()
  {
    final Band b = new Band();
    b.setName("office");
    b.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.TRUE);
    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(12));

    LabelElementFactory labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    labelFactory.setMinimumSize(new FloatDimension(200, 15));
    labelFactory.setText("People in the same office:");
    b.addElement(labelFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Notes:");
    b.addElement(labelFactory.createElement());

    final Element line = HorizontalLineElementFactory.createHorizontalLine(15);
    line.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(1));
    b.addElement(line);

    final Group group = report.getGroupByName("record-group");
    group.getHeader().addElement(b);
  }
View Full Code Here


    group.getHeader().addElement(b);
  }

  private void configureItemBand()
  {
    final Band b = new Band();
    b.setName("office");
    b.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.FALSE);
    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));

    TextFieldElementFactory textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("office.Name");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(200, 12));
    b.addElement(textFieldFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("office.Annotations");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    textFieldFactory.setDynamicHeight(Boolean.TRUE);
    b.addElement(textFieldFactory.createElement());

    report.getItemBand().addElement(b);

  }
View Full Code Here

  /**
   * Default Constructor that constructs generic bands.
   */
  public BandElementFactory()
  {
    this(new Band());
  }
View Full Code Here

    ClassicEngineBoot.getInstance().start();
  }

  public void testStyleInheritance()
  {
    final Band band = new Band();
    band.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.YELLOW);

    final Element element = new Element();
    band.addElement(element);

    assertNull(element.getStyle().getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR));
    band.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, Color.GREEN);
    assertNull(element.getStyle().getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR));
  }
View Full Code Here

    configureFunctions();
  }

  private void configureRecordGroup()
  {
    final Band b = new Band();
    b.setName("activitylog");
    b.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.TRUE);
    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(12));

    LabelElementFactory labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    labelFactory.setMinimumSize(new FloatDimension(200, 15));
    labelFactory.setText("Time");
    b.addElement(labelFactory.createElement());

    labelFactory = new LabelElementFactory();
    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Task");
    b.addElement(labelFactory.createElement());

    b.addElement(HorizontalLineElementFactory.createHorizontalLine
        (15, null, new BasicStroke(1)));

    final Group group = report.getGroupByName("record-group");
    group.getHeader().addElement(b);
  }
View Full Code Here

    group.getHeader().addElement(b);
  }

  private void configureItemBand()
  {
    final Band b = new Band();
    b.setName("activitylog");
    b.getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.FALSE);
    b.getStyle().setStyleProperty(TextStyleKeys.FONT, "SansSerif");
    b.getStyle().setStyleProperty(TextStyleKeys.FONTSIZE, new Integer(10));

    TextFieldElementFactory textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("activitylog.Time");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(0, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(200, 12));
    b.addElement(textFieldFactory.createElement());

    textFieldFactory = new TextFieldElementFactory();
    textFieldFactory.setFieldname("activitylog.Task");
    textFieldFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    textFieldFactory.setMinimumSize(new FloatDimension(-100, 12));
    textFieldFactory.setDynamicHeight(Boolean.TRUE);
    b.addElement(textFieldFactory.createElement());

    report.getItemBand().addElement(b);
  }
View Full Code Here

    {
      final int groupIdx = groupCount - i - 1;
      final int wizGroupIdx = wizardCount - i - 1;
      final GroupDefinition gd = groupDefinitions[wizGroupIdx];
      final Group g = definition.getGroup(groupIdx);
      final Band groupHeader = g.getHeader();
      final Band groupFooter = g.getFooter();

      iterateSection(groupHeader, new UpdateHeaderTask(gd));
      iterateSection(groupFooter, new UpdateFooterTask(gd));
    }

    final Band itemband = definition.getItemBand();
    final Band detailsHeader = definition.getDetailsHeader();
    final Band detailsFooter = definition.getDetailsFooter();

    final DetailFieldDefinition[] detailFieldDefinitions = wizardSpecification.getDetailFieldDefinitions();
    for (int i = 0; i < detailFieldDefinitions.length; i++)
    {
      final DetailFieldDefinition fieldDefinition = detailFieldDefinitions[i];
View Full Code Here

      configureCrosstabColumnGroup(relationalGroup, groupDefinition);
      insertGroup.setBody(new CrosstabColumnGroupBody(relationalGroup));
      insertGroup = relationalGroup;
    }

    final Band itemBand = AutoGeneratorUtility.findGeneratedContent(definition.getItemBand());
    if (itemBand == null)
    {
      return;
    }
    final DetailFieldDefinition[] detailFieldDefinitions = wizardSpecification.getDetailFieldDefinitions();
    if (detailFieldDefinitions.length == 0)
    {
      return;
    }

    final Float[] widthSpecs = new Float[detailFieldDefinitions.length];
    for (int i = 0; i < detailFieldDefinitions.length; i++)
    {
      final DetailFieldDefinition fieldDefinition = detailFieldDefinitions[i];
      final Length length = fieldDefinition.getWidth();
      if (length == null)
      {
        continue;
      }
      widthSpecs[i] = length.getNormalizedValue();
    }
    final float[] computedWidth =
        AutoGeneratorUtility.computeFieldWidths(widthSpecs, definition.getPageDefinition().getWidth());


    itemBand.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "row");
    for (int i = 0; i < detailFieldDefinitions.length; i++)
    {
      final DetailFieldDefinition detailFieldDefinition = detailFieldDefinitions[i];
      setupField(null, null, itemBand, detailFieldDefinition, computedWidth[i]);
    }
View Full Code Here

    }

    definition.getDetailsHeader().setRepeat(true);
    definition.getDetailsFooter().setRepeat(true);

    final Band detailsHeader = AutoGeneratorUtility.findGeneratedContent(definition.getDetailsHeader());
    final Band detailsFooter = AutoGeneratorUtility.findGeneratedContent(definition.getDetailsFooter());
    final Band itemBand = AutoGeneratorUtility.findGeneratedContent(definition.getItemBand());

    if (itemBand == null)
    {
      return;
    }

    final Float[] widthSpecs = new Float[detailFieldDefinitions.length];
    for (int i = 0; i < detailFieldDefinitions.length; i++)
    {
      final DetailFieldDefinition fieldDefinition = detailFieldDefinitions[i];
      final Length length = fieldDefinition.getWidth();
      if (length == null)
      {
        continue;
      }
      widthSpecs[i] = length.getNormalizedValue();
    }
    final float[] computedWidth =
        AutoGeneratorUtility.computeFieldWidths(widthSpecs, definition.getPageDefinition().getWidth());

    itemBand.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "row");
    if (detailsHeader != null)
    {
      detailsHeader.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "row");
    }
    if (detailsFooter != null)
View Full Code Here

      if (repeat != null)
      {
        header.setRepeat(repeat.booleanValue());
      }

      final Band content = AutoGeneratorUtility.findGeneratedContent(header);
      if (content == null)
      {
        return;
      }

      final Element headerElement = AutoGeneratorUtility.generateDetailsElement
          (groupDefinition.getField(), computeElementType(groupDefinition));
      final Length length = groupDefinition.getWidth();
      if (length != null)
      {
        headerElement.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, length.getNormalizedValue());
      }
      headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, "CachedWizardFormatData", headerDefinition);
      headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, "CachedWizardFieldData", groupDefinition);

      content.clear();
      content.addElement(headerElement);
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.Band

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.