Source Code Cross Referenced for JFreeReport.java in  » Report » pentaho-report » org » jfree » report » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Report » pentaho report » org.jfree.report 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * ========================================
003:         * JFreeReport : a free Java report library
004:         * ========================================
005:         *
006:         * Project Info:  http://reporting.pentaho.org/
007:         *
008:         * (C) Copyright 2000-2007, by Object Refinery Limited, Pentaho Corporation and Contributors.
009:         *
010:         * This library is free software; you can redistribute it and/or modify it under the terms
011:         * of the GNU Lesser General Public License as published by the Free Software Foundation;
012:         * either version 2.1 of the License, or (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
015:         * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         * See the GNU Lesser General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU Lesser General Public License along with this
019:         * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
020:         * Boston, MA 02111-1307, USA.
021:         *
022:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
023:         * in the United States and other countries.]
024:         *
025:         * ------------
026:         * $Id: JFreeReport.java 3525 2007-10-16 11:43:48Z tmorgner $
027:         * ------------
028:         * (C) Copyright 2000-2005, by Object Refinery Limited.
029:         * (C) Copyright 2005-2007, by Pentaho Corporation.
030:         */package org.jfree.report;
031:
032:        import java.awt.print.PageFormat;
033:        import java.util.ArrayList;
034:        import java.util.Locale;
035:        import javax.swing.table.TableModel;
036:
037:        import org.jfree.base.config.HierarchicalConfiguration;
038:        import org.jfree.base.config.ModifiableConfiguration;
039:        import org.jfree.layouting.input.style.CSSPageRule;
040:        import org.jfree.layouting.input.style.StyleSheet;
041:        import org.jfree.layouting.input.style.StyleSheetUtility;
042:        import org.jfree.report.flow.ReportStructureRoot;
043:        import org.jfree.report.structure.ReportDefinition;
044:        import org.jfree.report.util.ReportParameters;
045:        import org.jfree.resourceloader.ResourceKey;
046:        import org.jfree.resourceloader.ResourceManager;
047:        import org.jfree.util.Configuration;
048:
049:        /**
050:         * A JFreeReport instance is used as report template to define the visual layout
051:         * of a report and to collect all data sources for the reporting. Possible data
052:         * sources are the {@link TableModel}, {@link org.jfree.report.expressions.Expression}s
053:         * or {@link ReportParameters}.
054:         * <p/>
055:         * New since 0.9: Report properties contain data. They do not contain processing
056:         * objects (like the outputtarget) or attribute values. Report properties should
057:         * only contains things, which are intended for printing.
058:         * <p/>
059:         * The report data source is no longer part of the report definition. It is an
060:         * extra object passed over to the report processor or generated using a report
061:         * data factory.
062:         *
063:         * @author David Gilbert
064:         * @author Thomas Morgner
065:         */
066:        public class JFreeReport extends ReportDefinition implements 
067:                ReportStructureRoot {
068:            /**
069:             * The report configuration.
070:             */
071:            private ModifiableConfiguration reportConfiguration;
072:
073:            private ArrayList styleSheets;
074:            private StyleSheet pageFormatStyleSheet;
075:            private CSSPageRule pageRule;
076:
077:            private ReportParameters parameters;
078:
079:            private ReportDataFactory dataFactory;
080:
081:            private ResourceManager resourceManager;
082:            private ResourceKey baseResource;
083:
084:            /**
085:             * The default constructor. Creates an empty but fully initialized report.
086:             */
087:            public JFreeReport() {
088:                setType("report");
089:                this .reportConfiguration = new HierarchicalConfiguration(
090:                        JFreeReportBoot.getInstance().getGlobalConfig());
091:
092:                this .styleSheets = new ArrayList();
093:                this .parameters = new ReportParameters();
094:                this .dataFactory = new EmptyReportDataFactory();
095:
096:                this .pageFormatStyleSheet = new StyleSheet();
097:                this .pageRule = new CSSPageRule(pageFormatStyleSheet, null,
098:                        null, null);
099:                this .pageFormatStyleSheet.addRule(pageRule);
100:
101:                setQuery("default");
102:            }
103:
104:            /**
105:             * Returns the report configuration.
106:             * <p/>
107:             * The report configuration is automatically set up when the report is first
108:             * created, and uses the global JFreeReport configuration as its parent.
109:             *
110:             * @return the report configuration.
111:             */
112:            public Configuration getConfiguration() {
113:                return reportConfiguration;
114:            }
115:
116:            public void addStyleSheet(final StyleSheet s) {
117:                if (s == null) {
118:                    throw new NullPointerException();
119:                }
120:                styleSheets.add(s);
121:            }
122:
123:            public void removeStyleSheet(final StyleSheet s) {
124:                styleSheets.remove(s);
125:            }
126:
127:            public StyleSheet getStyleSheet(final int i) {
128:                if (i == 0) {
129:                    return pageFormatStyleSheet;
130:                }
131:                return (StyleSheet) styleSheets.get(i - 1);
132:            }
133:
134:            public int getStyleSheetCount() {
135:                return styleSheets.size() + 1;
136:            }
137:
138:            public JFreeReport getRootReport() {
139:                return this ;
140:            }
141:
142:            public ReportParameters getInputParameters() {
143:                return parameters;
144:            }
145:
146:            public ReportDataFactory getDataFactory() {
147:                return dataFactory;
148:            }
149:
150:            public void setDataFactory(final ReportDataFactory dataFactory) {
151:                if (dataFactory == null) {
152:                    throw new NullPointerException();
153:                }
154:
155:                this .dataFactory = dataFactory;
156:            }
157:
158:            public ResourceManager getResourceManager() {
159:                if (resourceManager == null) {
160:                    resourceManager = new ResourceManager();
161:                    resourceManager.registerDefaults();
162:                }
163:                return resourceManager;
164:            }
165:
166:            public void setResourceManager(final ResourceManager resourceManager) {
167:                this .resourceManager = resourceManager;
168:            }
169:
170:            public ResourceKey getBaseResource() {
171:                return baseResource;
172:            }
173:
174:            public void setBaseResource(final ResourceKey baseResource) {
175:                this .baseResource = baseResource;
176:            }
177:
178:            public void setPageFormat(final PageFormat format) {
179:                pageRule.clear();
180:                StyleSheetUtility.updateRuleForPage(pageRule, format);
181:            }
182:
183:            public PageFormat getPageFormat() {
184:                return StyleSheetUtility.getPageFormat(pageRule);
185:            }
186:
187:            public ModifiableConfiguration getEditableConfiguration() {
188:                return reportConfiguration;
189:            }
190:
191:            public Locale getLocale() {
192:                final Locale locale = super .getLocale();
193:                if (locale == null) {
194:                    return Locale.getDefault();
195:                }
196:                return locale;
197:            }
198:
199:            /**
200:             private ModifiableConfiguration reportConfiguration;
201:
202:             private ArrayList styleSheets;
203:             private StyleSheet pageFormatStyleSheet;
204:             private CSSPageRule pageRule;
205:
206:             private ReportParameters parameters;
207:
208:             private ReportDataFactory dataFactory;
209:
210:             private ResourceManager resourceManager;
211:             private ResourceKey baseResource;
212:             *
213:             * @return
214:             * @throws CloneNotSupportedException
215:             */
216:            public Object clone() throws CloneNotSupportedException {
217:                final JFreeReport report = (JFreeReport) super .clone();
218:                report.dataFactory = dataFactory.derive();
219:                report.parameters = (ReportParameters) parameters.clone();
220:                report.pageRule = (CSSPageRule) pageRule.clone();
221:                report.styleSheets = (ArrayList) styleSheets.clone();
222:                report.pageFormatStyleSheet = pageFormatStyleSheet;
223:                return report;
224:            }
225:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.