001 package org.openstreetmap.josm.data.osm.event; 002 /* 003 * JOSMng - a Java Open Street Map editor, the next generation. 004 005 * 006 * Copyright (C) 2008 Petr Nejedly <P.Nejedly@sh.cvut.cz> 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License as published by 010 * the Free Software Foundation; either version 2 of the License, or 011 * (at your option) any later version. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 018 * You should have received a copy of the GNU General Public License along 019 * with this program; if not, write to the Free Software Foundation, Inc., 020 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 021 */ 022 023 /** 024 * A listener listening for all DataSet changes. 025 * 026 * @see DataSetListenerAdapter 027 * @author nenik 028 */ 029 public interface DataSetListener { 030 /** 031 * A bunch of primitives were added into the DataSet, or existing 032 * deleted/invisible primitives were resurrected. 033 * 034 * @param added A collection of newly-visible primitives 035 */ 036 void primitivesAdded(PrimitivesAddedEvent event); 037 038 /** 039 * A bunch of primitives were removed from the DataSet, or preexisting 040 * primitives were marked as deleted. 041 * 042 * @param removed A collection of newly-invisible primitives 043 */ 044 void primitivesRemoved(PrimitivesRemovedEvent event); 045 046 /** 047 * There was some change in the tag set of a primitive. It can have been 048 * a tag addition, tag removal or change in tag value. 049 * 050 * @param prim the primitive, whose tags were affected. 051 */ 052 void tagsChanged(TagsChangedEvent event); 053 054 /** 055 * A node's coordinates were modified. 056 * @param node The node that was moved. 057 */ 058 void nodeMoved(NodeMovedEvent event); 059 060 /** 061 * A way's node list was changed. 062 * @param way The way that was modified. 063 */ 064 void wayNodesChanged(WayNodesChangedEvent event); 065 066 /** 067 * A relation's members have changed. 068 * @param relation The relation that was modified. 069 */ 070 void relationMembersChanged(RelationMembersChangedEvent event); 071 072 /** 073 * Minor dataset change, currently only changeset id changed is supported, but can 074 * be extended in future. 075 * @param event 076 */ 077 void otherDatasetChange(AbstractDatasetChangedEvent event); 078 079 /** 080 * Called after big changes in dataset. Usually other events are stopped using Dataset.beginUpdate() and 081 * after operation is completed (Dataset.endUpdate()), {@link #dataChanged()} is called. 082 */ 083 void dataChanged(DataChangedEvent event); 084 }