Source Code Cross Referenced for ReportEvent.java in  » Report » pentaho-report » org » jfree » report » event » 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.event 
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:         * ReportEvent.java
027:         * ------------
028:         * (C) Copyright 2001-2007, by Object Refinery Ltd, Pentaho Corporation and Contributors.
029:         */package org.jfree.report.event;
030:
031:        import java.util.EventObject;
032:
033:        import org.jfree.report.DataRow;
034:        import org.jfree.report.ReportDefinition;
035:        import org.jfree.report.states.ReportState;
036:
037:        /**
038:         * Represents a report event.
039:         * <p/>
040:         * Includes information which {@link org.jfree.report.states.ReportState} generated the event.
041:         *
042:         * @author Thomas Morgner
043:         */
044:        public class ReportEvent extends EventObject {
045:            /**
046:             * The event type constant, that the report initialize event is invoked.
047:             */
048:            public static final int REPORT_INITIALIZED = 0x01;
049:            /**
050:             * The event type constant, that the page start event is invoked.
051:             */
052:            public static final int PAGE_STARTED = 0x02;
053:            /**
054:             * The event type constant, that the report start event is invoked.
055:             */
056:            public static final int REPORT_STARTED = 0x04;
057:            /**
058:             * The event type constant, that a group start event is invoked.
059:             */
060:            public static final int GROUP_STARTED = 0x08;
061:            /**
062:             * The event type constant, that the items started event is invoked.
063:             */
064:            public static final int ITEMS_STARTED = 0x10;
065:            /**
066:             * The event type constant, that the items advanced event is invoked.
067:             */
068:            public static final int ITEMS_ADVANCED = 0x20;
069:            /**
070:             * The event type constant, that the items finished event is invoked.
071:             */
072:            public static final int ITEMS_FINISHED = 0x40;
073:            /**
074:             * The event type constant, that a group finished event is invoked.
075:             */
076:            public static final int GROUP_FINISHED = 0x80;
077:            /**
078:             * The event type constant, that the report finished event is invoked.
079:             */
080:            public static final int REPORT_FINISHED = 0x100;
081:            /**
082:             * The event type constant, that the report done event is invoked.
083:             */
084:            public static final int REPORT_DONE = 0x200;
085:            /**
086:             * The event type constant, that the page finished event is invoked.
087:             */
088:            public static final int PAGE_FINISHED = 0x400;
089:            /**
090:             * The event type constant, that the page finished event is invoked.
091:             *
092:             * @deprecated No longer used.
093:             */
094:            public static final int PAGE_CANCELED = 0x800;
095:            /**
096:             * The event type constant, that the post group footer state will be processed. This event is never fired.
097:             */
098:            public static final int POST_GROUP_FOOTER = 0x1000;
099:            /**
100:             * The event type constant, that the post group header state will be processed. This event is never fired.
101:             */
102:            public static final int POST_GROUP_HEADER = 0x4000;
103:            /**
104:             * The event type constant, that the page rollback event is invoked.
105:             *
106:             * @deprecated No longer used.
107:             */
108:            public static final int PAGE_ROLLEDBACK = 0x8000;
109:
110:            /**
111:             * The event type constant, that this event is a prepare event. Use this constant in combination with one of the other
112:             * event types to specify which kind of event was prepared.
113:             */
114:            public static final int PREPARE_EVENT = 0x2000000;
115:
116:            /**
117:             * A flag that marks the given event as a deep-traversing event. This flag is an indicator, that the event did not
118:             * originate in this report, so it propably came from a parent or child report.
119:             */
120:            public static final int DEEP_TRAVERSING_EVENT = 0x4000000;
121:
122:            /**
123:             * The event type for this event.
124:             */
125:            private int type;
126:
127:            /**
128:             * The state that generated the event in the first place. For master reports this is the same as the event source, for
129:             * master-reports receiving events from a sub-report, this is the subreport's report state.
130:             */
131:            private ReportState originatingState;
132:
133:            /**
134:             * Creates a new <code>ReportEvent</code>.
135:             *
136:             * @param state the current state of the processed report (<code>null</code> not permmitted).
137:             * @param type  the event type for this event object.
138:             */
139:            public ReportEvent(final ReportState state, final int type) {
140:                super (state);
141:                if (state == null) {
142:                    throw new NullPointerException(
143:                            "ReportEvent(ReportState) : null not permitted.");
144:                }
145:                if (type <= 0) {
146:                    throw new IllegalArgumentException(
147:                            "This is not a valid EventType: " + type);
148:                }
149:                this .type = type;
150:                this .originatingState = state;
151:            }
152:
153:            /**
154:             * Creates a new <code>ReportEvent</code>.
155:             *
156:             * @param state            the current state of the processed report (<code>null</code> not permmitted).
157:             * @param originatingState the original state that generated the event.
158:             * @param type             the event type for this event object.
159:             */
160:            public ReportEvent(final ReportState state,
161:                    final ReportState originatingState, final int type) {
162:                this (state, type);
163:                if (originatingState == null) {
164:                    throw new NullPointerException(
165:                            "Originating state can never be null.");
166:                }
167:                this .originatingState = originatingState;
168:            }
169:
170:            /**
171:             * Returns the event type. The type is made up of a combination of several flags.
172:             *
173:             * @return the event type.
174:             */
175:            public int getType() {
176:                return type;
177:            }
178:
179:            /**
180:             * Returns the <code>ReportState</code>, which is the source of the event.
181:             *
182:             * @return the state (never <code>null</code>).
183:             */
184:            public ReportState getState() {
185:                return (ReportState) getSource();
186:            }
187:
188:            /**
189:             * Returns the originating state. The originating state is the state, that generated the event in the first place. For
190:             * master reports this is the same as the event source, for master-reports receiving events from a sub-report, this is
191:             * the subreport's report state.
192:             *
193:             * @return the originating state.
194:             */
195:            public ReportState getOriginatingState() {
196:                return originatingState;
197:            }
198:
199:            /**
200:             * Returns the report that generated the event. <P> This is a convenience method that extracts the report from the
201:             * report state.
202:             *
203:             * @return the report.
204:             */
205:            public ReportDefinition getReport() {
206:                return getState().getReport();
207:            }
208:
209:            /**
210:             * Returns the currently assigned dataRow for this event.
211:             * <p/>
212:             * The {@link DataRow} is used to access the fields of the {@link org.jfree.report.filter.DataSource} and other
213:             * functions and expressions within the current row of the report.
214:             *
215:             * @return the data row.
216:             */
217:            public DataRow getDataRow() {
218:                return getState().getDataRow();
219:            }
220:
221:            /**
222:             * Returns the current function level.
223:             *
224:             * @return the function level.
225:             */
226:            public int getLevel() {
227:                return getState().getLevel();
228:            }
229:
230:            /**
231:             * Checks, whether the deep-traversing flag is set. An event is deep-traversing, if it did not originate in the
232:             * current report.
233:             *
234:             * @return true, if this is a deep-traversing element, false otherwise.
235:             */
236:            public boolean isDeepTraversing() {
237:                return (type & ReportEvent.DEEP_TRAVERSING_EVENT) == ReportEvent.DEEP_TRAVERSING_EVENT;
238:            }
239:
240:            /**
241:             * Checks, whether this event is a prepare event. Prepare events are fired before the real event is fired and
242:             * sometimes simplify the state-management inside complex functions.
243:             *
244:             * @return true, if this event is a prepare event, false otherwise.
245:             */
246:            public boolean isPrepareEvent() {
247:                return (type & ReportEvent.PREPARE_EVENT) == ReportEvent.PREPARE_EVENT;
248:            }
249:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.