001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.osm;
003
004/**
005 * This is a listener that listens to highlight segment changes.
006 * @author Michael Zangl
007 * @since 12014
008 */
009@FunctionalInterface
010public interface HighlightUpdateListener {
011
012    /**
013     * An event that is fired whenever highlighting on the OSM {@link DataSet} changed.
014     * @author Michael Zangl
015     * @since 12014
016     */
017    class HighlightUpdateEvent {
018        private final DataSet dataSet;
019
020        /**
021         * Create a new highlight update event.
022         * @param dataSet The dataset that was changed.
023         */
024        public HighlightUpdateEvent(DataSet dataSet) {
025            this.dataSet = dataSet;
026        }
027
028        /**
029         * Get the modified data set.
030         * @return The data set.
031         */
032        public DataSet getDataSet() {
033            return dataSet;
034        }
035    }
036
037    /**
038     * Called whenever the highlighting of way segments in the dataset changed.
039     * @param e The dataset highlight event.
040     */
041    void highlightUpdated(HighlightUpdateEvent e);
042}