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 public MapMarkerDot(String name, Coordinate coord) { 024 this(null, name, coord); 025 } 026 public MapMarkerDot(Layer layer, Coordinate coord) { 027 this(layer, null, coord); 028 } 029 public MapMarkerDot(Layer layer, String name, Coordinate coord) { 030 this(layer, name, coord, getDefaultStyle()); 031 } 032 public MapMarkerDot(Color color, double lat, double lon) { 033 this(null, null, lat, lon); 034 setColor(color); 035 } 036 public MapMarkerDot(double lat, double lon) { 037 this(null, null, lat, lon); 038 } 039 public MapMarkerDot(Layer layer, double lat, double lon) { 040 this(layer, null, lat, lon); 041 } 042 public MapMarkerDot(Layer layer, String name, double lat, double lon) { 043 this(layer, name, new Coordinate(lat, lon), getDefaultStyle()); 044 } 045 public MapMarkerDot(Layer layer, String name, Coordinate coord, Style style) { 046 super(layer, name, coord, DOT_RADIUS, STYLE.FIXED, style); 047 } 048 049 public static Style getDefaultStyle(){ 050 return new Style(Color.BLACK, Color.YELLOW, null, getDefaultFont()); 051 } 052}