01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.tests;
15:
16: import org.jetbrains.annotations.NotNull;
17: import org.jfree.report.ElementAlignment;
18: import org.jfree.report.JFreeReport;
19: import org.jfree.report.JFreeReportBoot;
20: import org.jfree.report.TableDataFactory;
21: import org.jfree.report.TextElement;
22: import org.jfree.report.elementfactory.LabelElementFactory;
23: import org.jfree.report.modules.gui.base.PreviewFrame;
24: import org.jfree.report.style.FontDefinition;
25: import org.pentaho.reportdesigner.crm.report.ReportDialogConstants;
26:
27: import javax.swing.table.DefaultTableModel;
28: import java.awt.*;
29: import java.awt.geom.Rectangle2D;
30:
31: /**
32: * User: Martin
33: * Date: 12.01.2006
34: * Time: 11:14:25
35: */
36: @SuppressWarnings({"ALL"})
37: public class ReportException001 {
38: public static void main(@NotNull
39: String[] args) {
40: JFreeReport report = new JFreeReport();
41: report.setName("ReportException001");
42:
43: TextElement labelElement = LabelElementFactory
44: .createLabelElement("Label1", new Rectangle2D.Double(0,
45: 0, 114, 38), Color.BLACK,
46: ElementAlignment.LEFT, new FontDefinition(
47: "dialog", 12),
48: "asd as da sd a sd as da sda sd a sdas d asd asd a sd a sd a sd a sd ");
49: labelElement.setLineHeight(20);
50: report.getReportHeader().addElement(labelElement);
51:
52: report.setDataFactory(new TableDataFactory(
53: ReportDialogConstants.DEFAULT_DATA_FACTORY,
54: new DefaultTableModel()));
55:
56: JFreeReportBoot.getInstance().start();
57: PreviewFrame preview = new PreviewFrame(report);
58: preview.pack();
59: preview.setVisible(true);
60: }
61: }
|