001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer.interfaces;
003
004import java.awt.Graphics;
005import java.awt.Point;
006
007import org.openstreetmap.gui.jmapviewer.Coordinate;
008import org.openstreetmap.gui.jmapviewer.JMapViewer;
009
010/**
011 * Interface to be implemented by rectangles that can be displayed on the map.
012 *
013 * @author Stefan Zeller
014 * @see JMapViewer#addMapRectangle(MapRectangle)
015 * @see JMapViewer#getMapRectangleList()
016 */
017public interface MapRectangle extends MapObject{
018
019    /**
020     * @return Latitude/Longitude of top left of rectangle
021     */
022    public Coordinate getTopLeft();
023
024    /**
025     * @return Latitude/Longitude of bottom right of rectangle
026     */
027    public Coordinate getBottomRight();
028
029    /**
030     * Paints the map rectangle on the map. The <code>topLeft</code> and
031     * <code>bottomRight</code> are specifying the coordinates within <code>g</code>
032     *
033     * @param g graphics structure for painting
034     * @param topLeft lop left edge of painting region
035     * @param bottomRight bottom right edge of painting region
036     */
037    public void paint(Graphics g, Point topLeft, Point bottomRight);
038}