001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.layer.markerlayer;
003
004import java.io.File;
005import java.util.Collection;
006
007import org.openstreetmap.josm.data.gpx.WayPoint;
008
009/**
010 * This interface has to be implemented by anyone who wants to create markers.
011 *
012 * When reading a gpx file, all implementations of MarkerMaker registered with
013 * the Marker are consecutively called until one returns a Marker object.
014 *
015 * @author Frederik Ramm
016 * @since   200 (creation)
017 * @since 10600 (functional interface)
018 */
019@FunctionalInterface
020public interface MarkerProducers {
021    /**
022     * Returns a collection of Marker objects if this implementation wants to create one for the
023     * given input data, or <code>null</code> otherwise.
024     *
025     * @param wp waypoint data
026     * @param relativePath An path to use for constructing relative URLs or
027     *        <code>null</code> for no relative URLs
028     * @param parentLayer parent marker layer
029     * @param time Absolute time of marker in seconds since epoch
030     * @param offset Time offset in seconds from the gpx point from which it was derived
031     * @return A collection of Marker objects, or <code>null</code>.
032     */
033    Collection<Marker> createMarkers(WayPoint wp, File relativePath, MarkerLayer parentLayer, double time, double offset);
034}