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