source: josm/trunk/src/org/openstreetmap/josm/data/osm/event/FilterChangedEvent.java @ 14206

Last change on this file since 14206 was 14206, checked in by Don-vip, 4 months ago

fix #16698, see #15670 - make sure filters are executed (costly operation) only when necessary:

  • data changes imply execution of filters only when at least a filter is enabled
  • filter changes imply execution of filters even is no filter is enabled
  • filter dataset change events should not trigger a new filter execution!
  • Property svn:eol-style set to native
File size: 966 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm.event;
3
4import java.util.Collection;
5import java.util.Collections;
6
7import org.openstreetmap.josm.data.osm.DataSet;
8import org.openstreetmap.josm.data.osm.OsmPrimitive;
9
10/**
11 * Represents a change of primitive filter flags.
12 * @since 14206
13 */
14public class FilterChangedEvent extends AbstractDatasetChangedEvent {
15
16    /**
17     * Constructs a new {@code FilterChangedEvent}.
18     * @param dataSet the dataset from which the event comes from
19     */
20    public FilterChangedEvent(DataSet dataSet) {
21        super(dataSet);
22    }
23
24    @Override
25    public void fire(DataSetListener listener) {
26        listener.otherDatasetChange(this);
27    }
28
29    @Override
30    public Collection<? extends OsmPrimitive> getPrimitives() {
31        return Collections.emptyList();
32    }
33
34    @Override
35    public DatasetEventType getType() {
36        return DatasetEventType.FILTERS_CHANGED;
37    }
38}
Note: See TracBrowser for help on using the repository browser.