001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer.interfaces;
003
004import java.awt.Graphics;
005import java.awt.Point;
006import java.awt.Polygon;
007import java.util.List;
008
009/**
010 * Interface to be implemented by polygons that can be displayed on the map.
011 *
012 * @author Vincent Privat
013 */
014public interface MapPolygon extends MapObject {
015
016    /**
017     * @return Latitude/Longitude of each point of polygon
018     */
019    List<? extends ICoordinate> getPoints();
020
021    /**
022     * Paints the map polygon on the map. The <code>points</code>
023     * are specifying the coordinates within <code>g</code>
024     *
025     * @param g graphics
026     * @param points list of points defining the polygon to draw
027     */
028    void paint(Graphics g, List<Point> points);
029
030    /**
031     * Paints the map polygon on the map. The <code>polygon</code>
032     * is specifying the coordinates within <code>g</code>
033     *
034     * @param g graphics
035     * @param polygon polygon to draw
036     */
037    void paint(Graphics g, Polygon polygon);
038}