001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer;
003
004import java.awt.Color;
005
006import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker;
007
008/**
009 * A simple implementation of the {@link MapMarker} interface. Each map marker
010 * is painted as a circle with a black border line and filled with a specified
011 * color.
012 *
013 * @author Jan Peter Stotz
014 *
015 */
016public class MapMarkerDot extends MapMarkerCircle {
017
018    public static final int DOT_RADIUS = 5;
019
020    public MapMarkerDot(Coordinate coord) {
021        this(null, null, coord);
022    }
023
024    public MapMarkerDot(String name, Coordinate coord) {
025        this(null, name, coord);
026    }
027
028    public MapMarkerDot(Layer layer, Coordinate coord) {
029        this(layer, null, coord);
030    }
031
032    public MapMarkerDot(Layer layer, String name, Coordinate coord) {
033        this(layer, name, coord, getDefaultStyle());
034    }
035
036    public MapMarkerDot(Color color, double lat, double lon) {
037        this(null, null, lat, lon);
038        setColor(color);
039    }
040
041    public MapMarkerDot(double lat, double lon) {
042        this(null, null, lat, lon);
043    }
044
045    public MapMarkerDot(Layer layer, double lat, double lon) {
046        this(layer, null, lat, lon);
047    }
048
049    public MapMarkerDot(Layer layer, String name, double lat, double lon) {
050        this(layer, name, new Coordinate(lat, lon), getDefaultStyle());
051    }
052
053    public MapMarkerDot(Layer layer, String name, Coordinate coord, Style style) {
054        super(layer, name, coord, DOT_RADIUS, STYLE.FIXED, style);
055    }
056
057    public static Style getDefaultStyle() {
058        return new Style(Color.BLACK, Color.YELLOW, null, getDefaultFont());
059    }
060}