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