Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ObjectChangedEvent |
|
| 1.0;1 |
1 | package org.jtheque.primary.view.impl.listeners; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.primary.od.able.Data; | |
20 | ||
21 | import java.util.EventObject; | |
22 | ||
23 | /** | |
24 | * An event who occurs when the object change. | |
25 | * | |
26 | * @author Baptiste Wicht | |
27 | */ | |
28 | public final class ObjectChangedEvent extends EventObject { | |
29 | private final Data object; | |
30 | ||
31 | /** | |
32 | * Construct a new ObjectChangedEvent. | |
33 | * | |
34 | * @param source The source of the event | |
35 | */ | |
36 | public ObjectChangedEvent(Object source){ | |
37 | 0 | this(source, null); |
38 | 0 | } |
39 | ||
40 | /** | |
41 | * Construct a new ObjectChangedEvent. | |
42 | * | |
43 | * @param source The source of the event | |
44 | * @param object The object who has changed | |
45 | */ | |
46 | public ObjectChangedEvent(Object source, Data object){ | |
47 | 0 | super(source); |
48 | ||
49 | 0 | this.object = object; |
50 | 0 | } |
51 | ||
52 | /** | |
53 | * Return the object of the event. | |
54 | * | |
55 | * @return The object. | |
56 | */ | |
57 | public Data getObject(){ | |
58 | 0 | return object; |
59 | } | |
60 | } |