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.elementfactory.LabelElementFactory;
22: import org.jfree.report.modules.gui.base.PreviewFrame;
23: import org.jfree.report.style.FontDefinition;
24: import org.pentaho.reportdesigner.crm.report.ReportDialogConstants;
25: import org.pentaho.reportdesigner.crm.report.tests.reportdata.ReportTableModel001;
26:
27: import java.awt.*;
28: import java.awt.geom.Rectangle2D;
29:
30: /**
31: * User: Martin
32: * Date: 06.10.2005
33: * Time: 15:55:11
34: */
35: @SuppressWarnings({"ALL"})
36: public class Report001 {
37: public static void main(@NotNull
38: String[] args) {
39: JFreeReport report = new JFreeReport();
40:
41: report.setName("SimpleAbsolutePositions");
42:
43: report.getReportHeader().addElement(
44: LabelElementFactory.createLabelElement("ReportTitle",
45: new Rectangle2D.Double(30, 0, 300, 50),
46: Color.RED, ElementAlignment.LEFT,
47: new FontDefinition("dialog", 40),
48: "Report Title"));
49:
50: report.setDataFactory(new TableDataFactory(
51: ReportDialogConstants.DEFAULT_DATA_FACTORY,
52: new ReportTableModel001()));
53:
54: JFreeReportBoot.getInstance().start();
55:
56: PreviewFrame preview = new PreviewFrame(report);
57: preview.pack();
58: preview.setVisible(true);
59: }
60: }
|