Changeset 11928 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-04-16T14:42:27+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/event
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/event/AbstractDatasetChangedEvent.java
r9941 r11928 7 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 8 8 9 /** 10 * Base class of all dataset change events. 11 * @since 2622 12 */ 9 13 public abstract class AbstractDatasetChangedEvent { 10 14 15 /** 16 * Type of dataset changed event, returned by {@link AbstractDatasetChangedEvent#getType}. 17 */ 11 18 public enum DatasetEventType { 12 19 DATA_CHANGED, … … 21 28 } 22 29 30 /** 31 * The dataset from which the event came from. 32 */ 23 33 protected final DataSet dataSet; 24 34 35 /** 36 * Constructs a new {@code AbstractDatasetChangedEvent}. 37 * @param dataSet the dataset from which the event came from 38 */ 25 39 protected AbstractDatasetChangedEvent(DataSet dataSet) { 26 40 this.dataSet = dataSet; 27 41 } 28 42 43 /** 44 * Calls the appropriate method of the listener for this event. 45 * @param listener dataset listener to notify about this event 46 */ 29 47 public abstract void fire(DataSetListener listener); 30 48 … … 40 58 public abstract Collection<? extends OsmPrimitive> getPrimitives(); 41 59 60 /** 61 * Returns the dataset from which the event came from. 62 * @return the dataset from which the event came from 63 */ 42 64 public DataSet getDataset() { 43 65 return dataSet; 44 66 } 45 67 68 /** 69 * Returns the type of dataset changed event. 70 * @return the type of dataset changed event 71 */ 46 72 public abstract DatasetEventType getType(); 47 73 -
trunk/src/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEvent.java
r5170 r11928 13 13 private final int newChangesetId; 14 14 15 /** 16 * Constructs a new {@code ChangesetIdChangedEvent}. 17 * @param dataSet the dataset from which the event comes from 18 * @param primitives list of affected primitives 19 * @param oldChangesetId old changeset id 20 * @param newChangesetId new changeset id 21 */ 15 22 public ChangesetIdChangedEvent(DataSet dataSet, List<OsmPrimitive> primitives, int oldChangesetId, int newChangesetId) { 16 23 super(dataSet); … … 35 42 } 36 43 44 /** 45 * Returns the old changeset id. 46 * @return the old changeset id 47 */ 37 48 public int getOldChangesetId() { 38 49 return oldChangesetId; 39 50 } 40 51 52 /** 53 * Returns the new changeset id. 54 * @return the new changeset id 55 */ 41 56 public int getNewChangesetId() { 42 57 return newChangesetId; -
trunk/src/org/openstreetmap/josm/data/osm/event/DataChangedEvent.java
r11553 r11928 15 15 /** 16 16 * Constructs a new {@code DataChangedEvent} 17 * @param dataSet data set17 * @param dataSet the dataset from which the event comes from 18 18 * @param events list of change events 19 19 */ … … 25 25 /** 26 26 * Constructs a new {@code DataChangedEvent} 27 * @param dataSet data set 27 * @param dataSet data set. Can be null 28 28 */ 29 29 public DataChangedEvent(DataSet dataSet) { -
trunk/src/org/openstreetmap/josm/data/osm/event/DataSetListenerAdapter.java
r10600 r11928 4 4 /** 5 5 * Classes that do not wish to implement all methods of DataSetListener 6 * may use this class. Implement DatasetListenerAdapter.Listenerand6 * may use this class. Implement {@link DataSetListenerAdapter.Listener} and 7 7 * pass this adapter instead of class itself. 8 * 8 * @since 2622 9 9 */ 10 10 public class DataSetListenerAdapter implements DataSetListener { 11 11 12 /** 13 * Single method dataset change event listener. 14 */ 12 15 @FunctionalInterface 13 16 public interface Listener { 17 /** 18 * Called when notified about any type of dataset change event. 19 * @param event dataset change event 20 */ 14 21 void processDatasetEvent(AbstractDatasetChangedEvent event); 15 22 } … … 17 24 private final Listener listener; 18 25 26 /** 27 * Constructs a new {@code DataSetListenerAdapter}. 28 * @param listener listener for which its {@code processDatasetEvent()} method will be called for all events 29 */ 19 30 public DataSetListenerAdapter(Listener listener) { 20 31 this.listener = listener; -
trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java
r11796 r11928 93 93 } 94 94 95 /** 96 * Event firing mode regarding Event Dispatch Thread. 97 */ 95 98 public enum FireMode { 96 99 /** … … 167 170 } 168 171 172 /** 173 * Unregister listener. 174 * @param listener listener to remove 175 */ 169 176 public void removeDatasetListener(DataSetListener listener) { 170 177 ListenerInfo searchListener = new ListenerInfo(listener, false); -
trunk/src/org/openstreetmap/josm/data/osm/event/NodeMovedEvent.java
r5170 r11928 13 13 private final Node node; 14 14 15 /** 16 * Constructs a new {@code NodeMovedEvent}. 17 * @param dataSet the dataset from which the event comes from 18 * @param node the node affected by the move 19 */ 15 20 public NodeMovedEvent(DataSet dataSet, Node node) { 16 21 super(dataSet); … … 23 28 } 24 29 30 /** 31 * Returns the node affected by the move. 32 * @return the node affected by the move 33 */ 25 34 public Node getNode() { 26 35 return node; … … 36 45 return DatasetEventType.NODE_MOVED; 37 46 } 38 39 47 } -
trunk/src/org/openstreetmap/josm/data/osm/event/PrimitiveFlagsChangedEvent.java
r9941 r11928 15 15 private final OsmPrimitive primitive; 16 16 17 /** 18 * Constructs a new {@code PrimitiveFlagsChangedEvent}. 19 * @param dataSet the dataset from which the event comes from 20 * @param primitive the primitive affected by the change 21 */ 17 22 public PrimitiveFlagsChangedEvent(DataSet dataSet, OsmPrimitive primitive) { 18 23 super(dataSet); -
trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEvent.java
r7005 r11928 15 15 private final boolean wasIncomplete; 16 16 17 /** 18 * Constructs a new {@code PrimitivesAddedEvent}. 19 * @param dataSet the dataset from which the event comes from 20 * @param primitives the list of primitives affected by the change 21 * @param wasIncomplete {@code true} if primitive was in dataset before (so it's not really added), but it was incomplete 22 */ 17 23 public PrimitivesAddedEvent(DataSet dataSet, Collection<? extends OsmPrimitive> primitives, boolean wasIncomplete) { 18 24 super(dataSet); … … 32 38 33 39 /** 34 * 35 * @return Trueif primitive was in dataset before (so it's not really added), but it was incomplete40 * Determines if primitive was in dataset before (so it's not really added), but it was incomplete 41 * @return {@code true} if primitive was in dataset before (so it's not really added), but it was incomplete 36 42 */ 37 43 public boolean wasIncomplete() { -
trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEvent.java
r7005 r11928 15 15 private final boolean wasComplete; 16 16 17 /** 18 * Constructs a new {@code PrimitivesRemovedEvent}. 19 * @param dataSet the dataset from which the event comes from 20 * @param primitives the list of primitives affected by the change 21 * @param wasComplete {@code true} if primitive wasn't really removed from the dataset, it only become incomplete again 22 */ 17 23 public PrimitivesRemovedEvent(DataSet dataSet, Collection<? extends OsmPrimitive> primitives, boolean wasComplete) { 18 24 super(dataSet); … … 32 38 33 39 /** 34 * 35 * @return Trueif primitive wasn't really removed from the dataset, it only become incomplete again40 * Determines if primitive wasn't really removed from the dataset, it only become incomplete again. 41 * @return {@code true} if primitive wasn't really removed from the dataset, it only become incomplete again 36 42 */ 37 43 public boolean wasComplete() { -
trunk/src/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEvent.java
r5170 r11928 13 13 private final Relation relation; 14 14 15 /** 16 * Constructs a new {@code RelationMembersChangedEvent}. 17 * @param dataSet the dataset from which the event comes from 18 * @param relation the relation affected by the change 19 */ 15 20 public RelationMembersChangedEvent(DataSet dataSet, Relation relation) { 16 21 super(dataSet); … … 23 28 } 24 29 30 /** 31 * Returns the relation affected by the change. 32 * @return the relation affected by the change 33 */ 25 34 public Relation getRelation() { 26 35 return relation; -
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r10608 r11928 17 17 * Similar like {@link DatasetEventManager}, just for selection events. Because currently selection changed 18 18 * event are global, only FIRE_IN_EDT and FIRE_EDT_CONSOLIDATED modes are really useful 19 * 19 * @since 2912 20 20 */ 21 21 public class SelectionEventManager implements SelectionChangedListener { … … 23 23 private static final SelectionEventManager instance = new SelectionEventManager(); 24 24 25 /** 26 * Returns the unique instance. 27 * @return the unique instance 28 */ 25 29 public static SelectionEventManager getInstance() { 26 30 return instance; … … 59 63 } 60 64 65 /** 66 * Registers a new {@code SelectionChangedListener}. 67 * @param listener listener to add 68 * @param fireMode EDT firing mode 69 */ 61 70 public void addSelectionListener(SelectionChangedListener listener, FireMode fireMode) { 62 71 if (fireMode == FireMode.IN_EDT) … … 69 78 } 70 79 80 /** 81 * Unregisters a {@code SelectionChangedListener}. 82 * @param listener listener to remove 83 */ 71 84 public void removeSelectionListener(SelectionChangedListener listener) { 72 85 ListenerInfo searchListener = new ListenerInfo(listener); -
trunk/src/org/openstreetmap/josm/data/osm/event/TagsChangedEvent.java
r5170 r11928 14 14 private final Map<String, String> originalKeys; 15 15 16 /** 17 * Constructs a new {@code TagsChangedEvent}. 18 * @param dataSet the dataset from which the event comes from 19 * @param primitive the primitive affected by the change 20 * @param originalKeys the original tags 21 */ 16 22 public TagsChangedEvent(DataSet dataSet, OsmPrimitive primitive, Map<String, String> originalKeys) { 17 23 super(dataSet); … … 25 31 } 26 32 33 /** 34 * Returns the primitive affected by the change. 35 * @return the primitive affected by the change 36 */ 27 37 public OsmPrimitive getPrimitive() { 28 38 return primitive; … … 39 49 } 40 50 51 /** 52 * Returns the original tags. 53 * @return the original tags 54 */ 41 55 public Map<String, String> getOriginalKeys() { 42 56 return originalKeys; -
trunk/src/org/openstreetmap/josm/data/osm/event/WayNodesChangedEvent.java
r5170 r11928 13 13 private final Way way; 14 14 15 /** 16 * Constructs a new {@code WayNodesChangedEvent}. 17 * @param dataSet the dataset from which the event comes from 18 * @param way the way affected by the change 19 */ 15 20 public WayNodesChangedEvent(DataSet dataSet, Way way) { 16 21 super(dataSet); … … 23 28 } 24 29 30 /** 31 * Returns the way affected by the change. 32 * @return the way affected by the change 33 */ 25 34 public Way getChangedWay() { 26 35 return way;
Note:
See TracChangeset
for help on using the changeset viewer.