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: * ReportListener.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.EventListener;
032:
033: /**
034: * ReportListeners get informed whenever the state of a report changes. <P> You should be
035: * aware that most events occur more than once. For example, the reportStarted event will
036: * be triggered every time the report is regenerated. <P> When handling these events, use
037: * the reportState to track the current changes of the report.
038: *
039: * @author Thomas Morgner
040: */
041: public interface ReportListener extends EventListener {
042: /**
043: * Receives notification that report generation initializes the current run. <P> The
044: * event carries a ReportState.Started state. Use this to initialize the report.
045: *
046: * @param event The event.
047: */
048: public void reportInitialized(ReportEvent event);
049:
050: /**
051: * Receives notification that report generation has started. <P> The event carries a
052: * ReportState.Started state. Use this to prepare the report header.
053: *
054: * @param event The event.
055: */
056: public void reportStarted(ReportEvent event);
057:
058: /**
059: * Receives notification that report generation has finished (the last record is read
060: * and all groups are closed).
061: *
062: * @param event The event.
063: */
064: public void reportFinished(ReportEvent event);
065:
066: /**
067: * Receives notification that report generation has completed, the report footer was
068: * printed, no more output is done. This is a helper event to shut down the output
069: * service.
070: *
071: * @param event The event.
072: */
073: public void reportDone(ReportEvent event);
074:
075: /**
076: * Receives notification that a new group has started. <P> The group can be determined
077: * by the report state's getCurrentGroup() function.
078: *
079: * @param event The event.
080: */
081: public void groupStarted(ReportEvent event);
082:
083: /**
084: * Receives notification that a group is finished. <P> The group can be determined by
085: * the report state's getCurrentGroup() function.
086: *
087: * @param event The event.
088: */
089: public void groupFinished(ReportEvent event);
090:
091: /**
092: * Receives notification that a group of item bands is about to be processed. <P> The
093: * next events will be itemsAdvanced events until the itemsFinished event is raised.
094: *
095: * @param event The event.
096: */
097: public void itemsStarted(ReportEvent event);
098:
099: /**
100: * Receives notification that a group of item bands has been completed. <P> The itemBand
101: * is finished, the report starts to close open groups.
102: *
103: * @param event The event.
104: */
105: public void itemsFinished(ReportEvent event);
106:
107: /**
108: * Receives notification that a new row has been read. <P> This event is raised before
109: * an ItemBand is printed.
110: *
111: * @param event The event.
112: */
113: public void itemsAdvanced(ReportEvent event);
114:
115: }
|