001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data;
003
004import java.util.Collection;
005
006import org.openstreetmap.josm.data.osm.DataSelectionListener;
007import org.openstreetmap.josm.data.osm.OsmPrimitive;
008import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
009
010/**
011 * This is a listener for selection changes through the dataset's data. Whenever
012 * a selection of any data member changes, the dataSet gets informed about this
013 * and fires a selectionChanged event.
014 *
015 * Note that these events are not fired immediately but are inserted in the
016 * Swing event queue and packed together. So only one selection changed event
017 * is issued within a one message dispatch routine.
018 *
019 * @see DataSelectionListener For a more advanced listener class.
020 * @see SelectionEventManager For managing your selection events.
021 *
022 * @author imi
023 * @since     8 (creation)
024 * @since 10600 (functional interface)
025 */
026@FunctionalInterface
027public interface SelectionChangedListener {
028
029    /**
030     * Informs the listener that the selection in the dataset has changed.
031     * @param newSelection The new selection.
032     * @deprecated use {@link DataSelectionListener} instead
033     */
034    @Deprecated
035    void selectionChanged(Collection<? extends OsmPrimitive> newSelection);
036}