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.ImageElement;
18: import org.jfree.report.JFreeReport;
19: import org.jfree.report.JFreeReportBoot;
20: import org.jfree.report.elementfactory.StaticImageURLElementFactory;
21: import org.jfree.report.modules.gui.base.PreviewFrame;
22:
23: import java.awt.geom.Rectangle2D;
24: import java.io.File;
25: import java.io.IOException;
26:
27: /**
28: * User: Martin
29: * Date: 06.10.2005
30: * Time: 15:54:54
31: */
32: @SuppressWarnings({"ALL"})
33: public class ImageScalingBugTest {
34: public static void main(@NotNull
35: String[] args) throws IOException {
36: JFreeReport report = new JFreeReport();
37: //StaticImageElementFactory sief = new StaticImageElementFactory();
38: //sief.setImage(new ImageIcon("C:\\temp\\sackmesser.jpg").getImage());
39: //sief.setMinimumSize(new Dimension(100, 100));
40: //sief.setScale(true);
41: //sief.setKeepAspectRatio(true);
42: //sief.setAbsolutePosition(new Point2D.Double(0, 0));
43:
44: ImageElement ie = StaticImageURLElementFactory
45: .createImageElement("test", new Rectangle2D.Double(0,
46: 0, 100, 100), new File(
47: "C:\\temp\\sackmesser.jpg").toURI().toURL(),
48: true, true);
49:
50: report.getReportHeader().addElement(ie);
51:
52: JFreeReportBoot.getInstance().start();
53: PreviewFrame preview = new PreviewFrame(report);
54: preview.pack();
55: preview.setVisible(true);
56: }
57:
58: }
|