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

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


  {
    MasterReport report = new MasterReport();

    report.setName("BorderTest");

    Element label1 = LabelElementFactory.createLabelElement("Label1",
        new Rectangle2D.Double(0, 0, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label1");

    report.getReportHeader().addElement(label1);

    label1.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));

    Element label2 = LabelElementFactory.createLabelElement("Label2",
        new Rectangle2D.Double(0, 110, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label2");

    report.getReportHeader().addElement(label2);

    label2.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(10));
    label2.getStyle().setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(10));


    Element label3 = LabelElementFactory.createLabelElement("Label3",
        new Rectangle2D.Double(210, 0, 200, 100),
        Color.RED,
        ElementAlignment.LEFT,
        new FontDefinition("Arial", 12),
        "Label3");

    report.getReportHeader().addElement(label3);

    label3.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_RIGHT, new Float(10));
    label3.getStyle().setStyleProperty(ElementStyleKeys.PADDING_BOTTOM, new Float(10));
    return report;
  }
View Full Code Here


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

    final Element element = TextFieldElementFactory.createStringElement(
        "CustomerField",
        new Rectangle2D.Double(110, 0, 250, 50),
        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(5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, BorderStyle.SOLID);

    //TODO Was f?r Werte muss ich w?hlen, damit die Linien nicht schr?g ?ber den Report laufen. Ich glaube hier ist etwas noch nicht richtig.
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_LEFT_RADIUS, new Dimension(5, 5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_LEFT_RADIUS, new Dimension(5, 5));
    element.getStyle().setStyleProperty(ElementStyleKeys.BORDER_TOP_RIGHT_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(5));
    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);

    //TODO Zum Testen mit halbtransparenter Farbe.
    //TODO Ein Rechteck wird hinter dem Text mit der originalgr?sse des Textes gezeichnet, und nicht mit der Elementgr?sse, auch wenn OVEFRFLOW_X nicht auf true gesetzt ist.
    //TODO Wird Transparenz bei Farben unterst?tzt?
    element.getStyle().setStyleProperty(ElementStyleKeys.BACKGROUND_COLOR, new Color(255, 127, 127, 120));

    //TODO padding-left wird auch als padding-top verwendet. Vermutlich verursacht durch den Fehler im ElementStyleKeys (siehe Mail)
    element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_LEFT, new Float(5));
    //element.getStyle().setStyleProperty(ElementStyleKeys.PADDING_TOP, new Float(5));

    //TODO sollte das Padding des Hintergrundes ber?cksichtigt werden, oder sollte der Hintergrund im Overflow-Bereich nicht erscheinen?
    //element.getStyle().setStyleProperty(ElementStyleKeys.OVERFLOW_X, Boolean.TRUE);
View Full Code Here

    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column1");

    final Element element1 = factory.createElement();
    report.getItemBand().addElement(element1);

    factory = new TextFieldElementFactory();
    factory.setName("T2");
    factory.setAbsolutePosition(new Point2D.Float(200, 0));
    factory.setMinimumSize(new FloatDimension(150, 20));
    factory.setColor(Color.black);
    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column2");

    final Element element2 = factory.createElement();
    report.getItemBand().addElement(element2);

    //report.getStyleSheetCollection().debug();

    report.getItemBand().removeElement(element1);
View Full Code Here

    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column1");

    final Element element1 = factory.createElement();
    report.getItemBand().addElement(element1);

    factory = new TextFieldElementFactory();
    factory.setName("T2");
    factory.setAbsolutePosition(new Point2D.Float(200, 0));
    factory.setMinimumSize(new FloatDimension(150, 20));
    factory.setColor(Color.black);
    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column2");

    final Element element2 = factory.createElement();
    report.getItemBand().addElement(element2);

    //report.getStyleSheetCollection().debug();

    report.getItemBand().removeElement(element1);
View Full Code Here

  private Element element;
  private AnchorFieldTemplate anchorFieldTemplate;

  public AnchorFieldElementReadHandler()
  {
    this.element = new Element();
    this.element.setElementType(LegacyType.INSTANCE);
    this.anchorFieldTemplate = new AnchorFieldTemplate();
    this.element.setDataSource(anchorFieldTemplate);
  }
View Full Code Here

  private Element element;
  private StrokeStyleDefinitionReadHandler strokeStyleDefinitionReadHandler;

  public LineReportElementReadHandler()
  {
    element = new Element();
    element.setElementType(new HorizontalLineType());
    element.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.TRUE);
    element.getStyle().setStyleProperty(ElementStyleKeys.DRAW_SHAPE, Boolean.TRUE);
  }
View Full Code Here

*/
public class LabelReportElementReadHandler extends AbstractTextElementReadHandler
{
  public LabelReportElementReadHandler()
  {
    final Element element = new Element();
    element.setElementType(new LabelType());
    setElement(element);
  }
View Full Code Here

  private Element element;
  private StrokeStyleDefinitionReadHandler strokeStyleDefinitionReadHandler;

  public EllipseElementReadHandler()
  {
    element = new Element();
    element.setElementType(new EllipseType());
    element.getStyle().setStyleProperty(ElementStyleKeys.SCALE, Boolean.TRUE);
  }
View Full Code Here

*/
public class DrawableFieldReportElementReadHandler extends AbstractTextElementReadHandler
{
  public DrawableFieldReportElementReadHandler()
  {
    final Element element = new Element();
    element.setElementType(new ContentFieldType());
    setElement(element);
  }
View Full Code Here

*/
public class ResourceLabelReportElementReadHandler extends AbstractTextElementReadHandler
{
  public ResourceLabelReportElementReadHandler()
  {
    final Element element = new Element();
    element.setElementType(new ResourceLabelType());
    setElement(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.