1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm.event;
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Classes that do not wish to implement all methods of DataSetListener
|
---|
6 | * may use this class. Implement DatasetListenerAdapter.Listener and
|
---|
7 | * pass this adapter instead of class itself.
|
---|
8 | *
|
---|
9 | */
|
---|
10 | public class DataSetListenerAdapter implements DataSetListener {
|
---|
11 |
|
---|
12 | public interface Listener {
|
---|
13 | void processDatasetEvent(AbstractDatasetChangedEvent event);
|
---|
14 | }
|
---|
15 |
|
---|
16 | private final Listener listener;
|
---|
17 |
|
---|
18 | public DataSetListenerAdapter(Listener listener) {
|
---|
19 | this.listener = listener;
|
---|
20 | }
|
---|
21 |
|
---|
22 | public void dataChanged(DataChangedEvent event) {
|
---|
23 | listener.processDatasetEvent(event);
|
---|
24 | }
|
---|
25 |
|
---|
26 | public void nodeMoved(NodeMovedEvent event) {
|
---|
27 | listener.processDatasetEvent(event);
|
---|
28 | }
|
---|
29 |
|
---|
30 | public void primtivesAdded(PrimitivesAddedEvent event) {
|
---|
31 | listener.processDatasetEvent(event);
|
---|
32 | }
|
---|
33 |
|
---|
34 | public void primtivesRemoved(PrimitivesRemovedEvent event) {
|
---|
35 | listener.processDatasetEvent(event);
|
---|
36 | }
|
---|
37 |
|
---|
38 | public void relationMembersChanged(RelationMembersChangedEvent event) {
|
---|
39 | listener.processDatasetEvent(event);
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void tagsChanged(TagsChangedEvent event) {
|
---|
43 | listener.processDatasetEvent(event);
|
---|
44 | }
|
---|
45 |
|
---|
46 | public void wayNodesChanged(WayNodesChangedEvent event) {
|
---|
47 | listener.processDatasetEvent(event);
|
---|
48 | }
|
---|
49 |
|
---|
50 | public void otherDatasetChange(AbstractDatasetChangedEvent event) {
|
---|
51 | listener.processDatasetEvent(event);
|
---|
52 | }
|
---|
53 |
|
---|
54 | }
|
---|