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: * ReportSubDatasetChangedEvent.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: import java.util.*;
038:
039: /**
040: * Save all info required by a ReportListenerElementsSelectionEvent
041: * Return the vector of selected elements (taked by the JReportFrame...)
042: * @author Administrator
043: */
044: public class ReportSubDatasetChangedEvent {
045:
046: private SubDataset subDataset;
047:
048: /**
049: * Object removed
050: */
051: public static final int REMOVED = 1; // 0001
052:
053: /**
054: * Object added
055: */
056: public static final int ADDED = 2; // 0010
057:
058: /**
059: * Object changed
060: */
061: public static final int CHANGED = 8; // 0100
062:
063: public static final int OBJECT_SUBDATASET = 1;
064: public static final int OBJECT_FIELD = 2;
065: public static final int OBJECT_PARAMETER = 3;
066: public static final int OBJECT_VARIABLE = 4;
067: public static final int OBJECT_QUERY = 5;
068: public static final int OBJECT_GROUP = 6;
069:
070: /**
071: * Objects changed/removed/added
072: */
073: private Vector elements = new Vector();
074:
075: /**
076: * The type of the element
077: */
078: private int action = 0;
079: private int objectType = 0;
080:
081: /** Creates a new instance of ReportListenerElementChangedEvent */
082: public ReportSubDatasetChangedEvent(SubDataset subDataset,
083: Object object, int action, int objectType) {
084: this .subDataset = subDataset;
085: this .setElements(new Vector());
086: this .getElements().add(object);
087: this .action = action;
088: this .objectType = objectType;
089: }
090:
091: public ReportSubDatasetChangedEvent(JReportFrame jReportFrame,
092: Vector objects, int objectType) {
093: this .subDataset = subDataset;
094: this .setElements(objects);
095: this .action = action;
096: this .objectType = objectType;
097: }
098:
099: public SubDataset getSubDataset() {
100: return subDataset;
101: }
102:
103: public void setSubDataset(SubDataset subDataset) {
104: this .subDataset = subDataset;
105: }
106:
107: /** Getter for property Action.
108: * Action can assume 3 values:
109: * REMOVED, ADDED, CHANGED
110: * What is removed is specified in the objectType attribute
111: * @return Value of property type.
112: *
113: */
114:
115: public int getAction() {
116: return action;
117: }
118:
119: public void setAction(int action) {
120: this .action = action;
121: }
122:
123: public int getObjectType() {
124: return objectType;
125: }
126:
127: public void setObjectType(int objectType) {
128: this .objectType = objectType;
129: }
130:
131: public Vector getElements() {
132: return elements;
133: }
134:
135: public void setElements(Vector elements) {
136: this.elements = elements;
137: }
138:
139: }
|