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

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


  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


   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new HorizontalLineType());
    return element;
  }
View Full Code Here

    return ef.createElement();
  }

  public static Element createHorizontalLine(final float y, final Color color, final Stroke stroke)
  {
    final Element element = createHorizontalLine(y);
    element.getStyle().setStyleProperty(ElementStyleKeys.PAINT, color);
    element.getStyle().setStyleProperty(ElementStyleKeys.STROKE, stroke);
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new ContentFieldType());
    if (getFieldname() != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }
    if (getNullValue() != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullValue());
    }
    if (getBaseURL() != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.CONTENT_BASE, getBaseURL());
    }
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new ContentType());
    if (content != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, content);
    }
    if (baseURL != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.CONTENT_BASE, baseURL);
    }
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new VerticalLineType());
    return element;
  }
View Full Code Here

        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "CustomerLabel"));

    Element element = TextFieldElementFactory.createStringElement(
        "CustomerField",
        new Rectangle2D.Double(210, 0, 150, 30),
        Color.black,
        ElementAlignment.LEFT,
        ElementAlignment.TOP,
        null, // font
        "-", // null string
        "Customer"
    );


    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_COLOR, Color.RED);
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH, new Float(1));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, BorderStyle.SOLID);

    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_LEFT_RADIUS, new Dimension(5, 5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_RIGHT_RADIUS, new Dimension(5, 5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS, new Dimension(5, 5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_RIGHT_RADIUS, new Dimension(5, 5));

    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_COLOR, Color.GREEN);
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_WIDTH, new Float(1));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE, BorderStyle.SOLID);

    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_COLOR, Color.YELLOW);
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_WIDTH, new Float(5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE, BorderStyle.SOLID);

    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_COLOR, Color.CYAN);
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_WIDTH, new Float(5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, BorderStyle.SOLID);

    element.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(5));
    element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(5));
    element.getStyle().setStyleProperty(ElementStyleKeys.OVERFLOW_X, Boolean.TRUE);

    report.getItemBand().addElement(element);
    report.setQuery("default");
    report.setDataFactory(new TableDataFactory("default", reportTableModel));
View Full Code Here

      final Element[] elements = band.getElementArray();
      for (int i = 0; i < elements.length; i++)
      {
        if (elements[i] instanceof Band)
        {
          final Element e = elements[i];
          e.setVisible(e.getName().equals(bandName));
        }
      }
    }
  }
View Full Code Here

   * @return the generated text field element
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());
    element.setElementType(new TextFieldType());
    if (getFieldname() != null)
    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }

    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    return element;
  }
View Full Code Here

  {
    super.doneParsing();
    for (int i = 0; i < items.size(); i++)
    {
      final XmlReadHandler handler = (XmlReadHandler) items.get(i);
      final Element element = (Element) handler.getObject();
      band.addElement(element);
    }
  }
View Full Code Here

TOP

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

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.