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