Source Code Cross Referenced for AbstractRootLevelBand.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 reporting library
004:         * ===========================================
005:         *
006:         * Project Info:  http://reporting.pentaho.org/
007:         *
008:         * (C) Copyright 2001-2007, by Object Refinery Ltd, 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:         * AbstractRootLevelBand.java
027:         * ------------
028:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029:         */package org.jfree.report;
030:
031:        import java.util.ArrayList;
032:
033:        /**
034:         * The root-level band is the container that is processed by a report-state. The root-level band processing
035:         * is atomic - so either the full band is processed or not processed at all. 
036:         *
037:         * @author Thomas Morgner
038:         */
039:        public abstract class AbstractRootLevelBand extends Band implements 
040:                RootLevelBand {
041:            /**
042:             * A empty array. (For performance reasons.)
043:             */
044:            private static final SubReport[] EMPTY_SUBREPORTS = new SubReport[0];
045:            /**
046:             * The list of follow-up root-level sub-reports.
047:             */
048:            private ArrayList subReports;
049:
050:            /**
051:             * Constructs a new band (initially empty).
052:             */
053:            protected AbstractRootLevelBand() {
054:            }
055:
056:            /**
057:             * Constructs a new band with the given pagebreak attributes. Pagebreak
058:             * attributes have no effect on subbands.
059:             *
060:             * @param pagebreakAfter  defines, whether a pagebreak should be done after
061:             *                        that band was printed.
062:             * @param pagebreakBefore defines, whether a pagebreak should be done before
063:             *                        that band gets printed.
064:             */
065:            protected AbstractRootLevelBand(final boolean pagebreakBefore,
066:                    final boolean pagebreakAfter) {
067:                super (pagebreakBefore, pagebreakAfter);
068:            }
069:
070:            /**
071:             * Assigns the report definition. Don't play with that function, unless you
072:             * know what you are doing. You might get burned.
073:             *
074:             * @param reportDefinition the report definition.
075:             */
076:            public void setReportDefinition(
077:                    final ReportDefinition reportDefinition) {
078:                super .setReportDefinition(reportDefinition);
079:            }
080:
081:            /**
082:             * Returns the number of subreports attached to this root level band.
083:             *
084:             * @return the number of subreports.
085:             */
086:            public int getSubReportCount() {
087:                if (subReports == null) {
088:                    return 0;
089:                }
090:                return subReports.size();
091:            }
092:
093:            /**
094:             * Clones this band and all elements contained in this band. After the cloning
095:             * the band is no longer connected to a report definition.
096:             *
097:             * @return the clone of this band.
098:             *
099:             * @throws CloneNotSupportedException if this band or an element contained in
100:             *                                    this band does not support cloning.
101:             */
102:            public Object clone() throws CloneNotSupportedException {
103:                final AbstractRootLevelBand rootLevelBand = (AbstractRootLevelBand) super 
104:                        .clone();
105:                if (rootLevelBand.subReports != null) {
106:                    rootLevelBand.subReports.clone();
107:                }
108:                return rootLevelBand;
109:            }
110:
111:            /**
112:             * Returns the subreport at the given index-position.
113:             *
114:             * @param index the index
115:             * @return the subreport stored at the given index.
116:             *
117:             * @throws IndexOutOfBoundsException if there is no such subreport.
118:             */
119:            public SubReport getSubReport(final int index) {
120:                if (subReports == null) {
121:                    throw new IndexOutOfBoundsException();
122:                }
123:                return (SubReport) subReports.get(index);
124:            }
125:
126:            /**
127:             * Attaches a new subreport at the end of the list.
128:             *
129:             * @param report the subreport, never null.
130:             */
131:            public void addSubReport(final SubReport report) {
132:                if (report == null) {
133:                    throw new NullPointerException(
134:                            "Parameter 'report' must not be null");
135:                }
136:
137:                if (subReports == null) {
138:                    subReports = new ArrayList();
139:                }
140:                subReports.add(report);
141:            }
142:
143:            /**
144:             * Removes the given subreport from the list of attached sub-reports.
145:             *
146:             * @param report the subreport to be removed.
147:             */
148:            public void removeSubreport(final SubReport report) {
149:                if (report == null) {
150:                    throw new NullPointerException(
151:                            "Parameter 'report' must not be null");
152:                }
153:                if (subReports == null) {
154:                    return;
155:                }
156:                subReports.remove(report);
157:            }
158:
159:            /**
160:             * Returns all sub-reports as array.
161:             *
162:             * @return the sub-reports as array.
163:             */
164:            public SubReport[] getSubReports() {
165:                if (subReports == null) {
166:                    return EMPTY_SUBREPORTS;
167:                }
168:                return (SubReport[]) subReports
169:                        .toArray(new SubReport[subReports.size()]);
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.