source: josm/trunk/src/org/openstreetmap/josm/data/osm/DataSetListener.java@ 2615

Last change on this file since 2615 was 2497, checked in by jttt, 14 years ago

Added Dataset.beginUpdate and Dataset.endUpdate that can be used to temporarily stop dataset events in case of big changes

  • Property svn:mime-type set to text/plain
File size: 2.5 KB
Line 
1/*
2 * JOSMng - a Java Open Street Map editor, the next generation.
3
4 *
5 * Copyright (C) 2008 Petr Nejedly <P.Nejedly@sh.cvut.cz>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22package org.openstreetmap.josm.data.osm;
23
24import java.util.Collection;
25
26/**
27 * A listener listening for all DataSet changes.
28 * INCOMPLETE (missing relation-related events)!
29 *
30 * @author nenik
31 */
32public interface DataSetListener {
33 /**
34 * A bunch of primitives were added into the DataSet, or existing
35 * deleted/invisible primitives were resurrected.
36 *
37 * @param added A collection of newly-visible primitives
38 */
39 void primtivesAdded(Collection<? extends OsmPrimitive> added);
40
41 /**
42 * A bunch of primitives were removed from the DataSet, or preexisting
43 * primitives were marked as deleted.
44 *
45 * @param removed A collection of newly-invisible primitives
46 */
47 void primtivesRemoved(Collection<? extends OsmPrimitive> removed);
48
49 /**
50 * There was some change in the tag set of a primitive. It can have been
51 * a tag addition, tag removal or change in tag value.
52 *
53 * @param prim the primitive, whose tags were affected.
54 */
55 void tagsChanged(OsmPrimitive prim);
56
57 /**
58 * A node's coordinates were modified.
59 * @param node The node that was moved.
60 */
61 void nodeMoved(Node node);
62
63 /**
64 * A way's node list was changed.
65 * @param way The way that was modified.
66 */
67 void wayNodesChanged(Way way);
68
69 /**
70 * A relation's members have changed.
71 * @param relation The relation that was modified.
72 */
73 void relationMembersChanged(Relation r);
74
75 /**
76 * Called after big changes in dataset. Usually other events are stopped using Dataset.beginUpdate() and
77 * after operation is completed (Dataset.endUpdate()), {@link #dataChanged()} is called.
78 */
79 void dataChanged();
80
81}
Note: See TracBrowser for help on using the repository browser.