KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > gui > event > ReportSubDatasetChangedEvent


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * ReportSubDatasetChangedEvent.java
28  *
29  * Created on 17 giugno 2003, 1.12
30  *
31  */

32
33 package it.businesslogic.ireport.gui.event;
34 import it.businesslogic.ireport.*;
35 import it.businesslogic.ireport.gui.*;
36 import java.util.*;
37 /**
38  * Save all info required by a ReportListenerElementsSelectionEvent
39  * Return the vector of selected elements (taked by the JReportFrame...)
40  * @author Administrator
41  */

42 public class ReportSubDatasetChangedEvent {
43     
44     private SubDataset subDataset;
45     
46     /**
47      * Object removed
48      */

49     public static final int REMOVED = 1; // 0001
50

51     /**
52      * Object added
53      */

54     public static final int ADDED = 2; // 0010
55

56     /**
57      * Object changed
58      */

59     public static final int CHANGED = 8; // 0100
60

61     public static final int OBJECT_SUBDATASET = 1;
62     public static final int OBJECT_FIELD = 2;
63     public static final int OBJECT_PARAMETER = 3;
64     public static final int OBJECT_VARIABLE = 4;
65     public static final int OBJECT_QUERY = 5;
66     public static final int OBJECT_GROUP = 6;
67
68     /**
69      * Objects changed/removed/added
70      */

71     private Vector elements = new Vector();
72
73     /**
74      * The type of the element
75      */

76     private int action = 0;
77     private int objectType = 0;
78     /** Creates a new instance of ReportListenerElementChangedEvent */
79     public ReportSubDatasetChangedEvent(SubDataset subDataset, Object JavaDoc object, int action, int objectType) {
80         this.subDataset = subDataset;
81         this.setElements(new Vector());
82         this.getElements().add(object);
83         this.action = action;
84         this.objectType = objectType;
85     }
86     
87     public ReportSubDatasetChangedEvent(JReportFrame jReportFrame, Vector objects, int objectType) {
88         this.subDataset = subDataset;
89         this.setElements(objects);
90         this.action = action;
91         this.objectType = objectType;
92     }
93         
94     public SubDataset getSubDataset() {
95         return subDataset;
96     }
97
98     public void setSubDataset(SubDataset subDataset) {
99         this.subDataset = subDataset;
100     }
101
102    /** Getter for property Action.
103      * Action can assume 3 values:
104      * REMOVED, ADDED, CHANGED
105      * What is removed is specified in the objectType attribute
106      * @return Value of property type.
107      *
108      */

109
110     public int getAction() {
111         return action;
112     }
113
114     public void setAction(int action) {
115         this.action = action;
116     }
117
118     public int getObjectType() {
119         return objectType;
120     }
121
122     public void setObjectType(int objectType) {
123         this.objectType = objectType;
124     }
125
126     public Vector getElements() {
127         return elements;
128     }
129
130     public void setElements(Vector elements) {
131         this.elements = elements;
132     }
133     
134 }
135
Popular Tags