View Javadoc

1   /***
2    * FilterChangeEvent.java
3    *
4    * This file is part of the creme library.
5    * The creme library intends to ease the development effort of large
6    * applications by providing easy to use support classes.
7    *
8    * Copyright (C) 2002 Denis Bregeon
9    *
10   * This library is free software; you can redistribute it and/or
11   * modify it under the terms of the GNU Lesser General Public
12   * License as published by the Free Software Foundation; either
13   * version 2.1 of the License, or (at your option) any later version.
14   *
15   * This library is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18   * Lesser General Public License for more details.
19   *
20   * You should have received a copy of the GNU Lesser General Public
21   * License along with this library; if not, write to the Free Software
22   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23   *
24   * contact information: dbregeon@sourceforge.net
25   */
26  package org.jcreme.filters;
27  
28  import java.util.EventObject;
29  
30  /***
31   * This class reports a change in a ReportFilter.
32   * 
33   * @author $Author: dbregeon $
34   * @version $Revision: 1.2 $
35   */
36  public class FilterChangeEvent extends EventObject {
37      static final long serialVersionUID = 5962195399096767432L;
38  
39  	/***
40       * The property that changed in the filter.
41       */
42      private final String propertyName;
43  
44      /***
45       * The previous value.
46       */
47      private final Object oldValue;
48  
49      /***
50       * The current value.
51       */
52      private final Object newValue;
53  
54      /***
55       * Creates new FilterChangeEvent
56       * 
57       * @param source
58       *            the ReportFilter that changed.
59       */
60      public FilterChangeEvent(ReportFilter source) {
61          super(source);
62          this.propertyName = null;
63          this.oldValue = null;
64          this.newValue = null;
65      }
66  
67      /***
68       * Creates new FilterChangeEvent
69       * 
70       * @param source
71       *            the ReportFilter that changed.
72       * @param propertyName
73       *            the property that changed in the source.
74       * @param oldValue
75       *            the previous value of the property.
76       * @param newValue
77       *            the current value of the property.
78       */
79      public FilterChangeEvent(ReportFilter source, String propertyName,
80              Object oldValue, Object newValue) {
81          super(source);
82          this.propertyName = propertyName;
83          this.oldValue = oldValue;
84          this.newValue = newValue;
85      }
86  
87      /***
88       * Gives access to the name of the modified property.
89       * 
90       * @return the name of the property that changed.
91       */
92      public String getPropertyName() {
93          return this.propertyName;
94      }
95  
96      /***
97       * Gives access to the previous value of the property.
98       * 
99       * @return the previous value of the property.
100      */
101     public Object getOldValue() {
102         return this.oldValue;
103     }
104 
105     /***
106      * Gives access to the current value of the property.
107      * 
108      * @return the new value of the property.
109      */
110     public Object getNewValue() {
111         return this.newValue;
112     }
113 }