001    package org.openstreetmap.gui.jmapviewer.interfaces;
002    
003    //License: GPL. Copyright 2009 by Stefan Zeller
004    
005    import java.awt.Graphics;
006    import java.awt.Point;
007    
008    import org.openstreetmap.gui.jmapviewer.Coordinate;
009    import 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     */
018    public interface MapRectangle {
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    }