001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * ReportBandChangedEvent.java
028: *
029: * Created on 17 giugno 2003, 1.12
030: *
031: */
032:
033: package it.businesslogic.ireport.gui.event;
034:
035: import it.businesslogic.ireport.*;
036: import it.businesslogic.ireport.gui.*;
037:
038: /**
039: * Save all info required by a ReportElementChangedEvent
040: * Return the band changed/removed/added
041: * @author Administrator
042: */
043: public class ReportBandChangedEvent {
044:
045: private JReportFrame jReportFrame;
046: /**
047: * The band was removed
048: */
049: public static final int REMOVED = 1;
050: /**
051: * An band was added
052: */
053: public static final int ADDED = 2;
054: /**
055: * The band was changed
056: */
057: public static final int CHANGED = 3;
058:
059: /**
060: * The band that is changed/removed/added
061: */
062: private Band band;
063:
064: /**
065: * Event source. This field can be null!
066: */
067: private Object source;
068:
069: public Object getSource() {
070: return source;
071: }
072:
073: public void setSource(Object source) {
074: this .source = source;
075: }
076:
077: /**
078: * The type of the element
079: */
080: private int type = 0;
081:
082: /** Creates a new instance of ReportBandChangedEvent */
083: public ReportBandChangedEvent(JReportFrame jReportFrame, Band band,
084: int type, Object source) {
085: this .jReportFrame = jReportFrame;
086: this .band = band;
087: this .type = type;
088: this .source = source;
089: }
090:
091: public ReportBandChangedEvent(JReportFrame jReportFrame, Band band,
092: int type) {
093: this (jReportFrame, band, type, null);
094: }
095:
096: /** Getter for property band.
097: * @return Value of property band.
098: *
099: */
100: public Band getBand() {
101: return band;
102: }
103:
104: /** Setter for property selectedElements.
105: * @param selectedElements New value of property selectedElements.
106: *
107: */
108: public void setBand(Band band) {
109: this .band = band;
110: }
111:
112: /** Getter for property type.
113: * Type can assume 3 values:
114: * REMOVED, ADDED, CHANGED
115: * @return Value of property type.
116: *
117: */
118: public int getType() {
119: return type;
120: }
121:
122: /** Setter for property type.
123: * @param type New value of property type.
124: *
125: */
126: public void setType(int type) {
127: this .type = type;
128: }
129:
130: /** Getter for property jReportFrame.
131: * @return Value of property jReportFrame.
132: *
133: */
134: public it.businesslogic.ireport.gui.JReportFrame getJReportFrame() {
135: return jReportFrame;
136: }
137:
138: /** Setter for property jReportFrame.
139: * @param jReportFrame New value of property jReportFrame.
140: *
141: */
142: public void setJReportFrame(
143: it.businesslogic.ireport.gui.JReportFrame jReportFrame) {
144: this.jReportFrame = jReportFrame;
145: }
146:
147: }
|