Changeset 29517 in osm
- Timestamp:
- 2013-04-19T23:52:11+02:00 (11 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java
r29514 r29517 188 188 Layer franceLayer = treeMap.addLayer("France"); 189 189 map().addMapMarker(new MapMarkerDot(franceLayer, "La Gallerie", 48.71, -1)); 190 map().addMapMarker(new MapMarkerDot(43.604, 1.444)); 191 map().addMapMarker(new MapMarkerCircle(53.343, -6.267, 0.666)); 192 map().addMapRectangle(new MapRectangleImpl(new Coordinate(53.343, -6.267), new Coordinate(43.604, 1.444))); 190 193 map().addMapMarker(darmstadt); 191 194 treeMap.addLayer(germanyWestLayer); -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java
r29513 r29517 26 26 STYLE markerStyle; 27 27 28 public MapMarkerCircle(Coordinate coord, double radius) { 29 this(null, null, coord, radius); 30 } 28 31 public MapMarkerCircle(String name, Coordinate coord, double radius) { 29 32 this(null, name, coord, radius); … … 31 34 public MapMarkerCircle(Layer layer, Coordinate coord, double radius) { 32 35 this(layer, null, coord, radius); 36 } 37 public MapMarkerCircle(double lat, double lon, double radius) { 38 this(null, null, new Coordinate(lat,lon), radius); 33 39 } 34 40 public MapMarkerCircle(Layer layer, double lat, double lon, double radius) { … … 99 105 else coord.setLon(lon); 100 106 } 101 102 107 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerDot.java
r29513 r29517 19 19 public static final int DOT_RADIUS = 5; 20 20 21 public MapMarkerDot(Coordinate coord) { 22 this(null, null, coord); 23 } 21 24 public MapMarkerDot(String name, Coordinate coord) { 22 25 this(null, name, coord); … … 27 30 public MapMarkerDot(Layer layer, String name, Coordinate coord) { 28 31 this(layer, name, coord, getDefaultStyle()); 32 } 33 public MapMarkerDot(Color color, double lat, double lon) { 34 this(null, null, lat, lon); 35 setColor(color); 36 } 37 public MapMarkerDot(double lat, double lon) { 38 this(null, null, lat, lon); 29 39 } 30 40 public MapMarkerDot(Layer layer, double lat, double lon) { -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapObjectImpl.java
r29513 r29517 37 37 } 38 38 public Style getStyleAssigned(){ 39 return style ==null?layer.getStyle():style;39 return style == null ? (layer == null ? null : layer.getStyle()) : style; 40 40 } 41 41 public void setStyle(Style style){ … … 43 43 } 44 44 public Color getColor() { 45 return getStyleAssigned().getColor(); 45 Style styleAssigned = getStyleAssigned(); 46 return styleAssigned == null ? null : getStyleAssigned().getColor(); 46 47 } 47 48 public void setColor(Color color) { … … 51 52 52 53 public Color getBackColor() { 53 return getStyleAssigned().getBackColor(); 54 Style styleAssigned = getStyleAssigned(); 55 return styleAssigned == null ? null : getStyleAssigned().getBackColor(); 54 56 } 55 57 public void setBackColor(Color backColor) { … … 59 61 60 62 public Stroke getStroke() { 61 return getStyleAssigned().getStroke(); 63 Style styleAssigned = getStyleAssigned(); 64 return styleAssigned == null ? null : getStyleAssigned().getStroke(); 62 65 } 63 66 public void setStroke(Stroke stroke) { … … 67 70 68 71 public Font getFont() { 69 return getStyleAssigned().getFont(); 72 Style styleAssigned = getStyleAssigned(); 73 return styleAssigned == null ? null : getStyleAssigned().getFont(); 70 74 } 71 75 public void setFont(Font font) { -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapRectangleImpl.java
r29516 r29517 20 20 private Coordinate bottomRight; 21 21 22 public MapRectangleImpl(Coordinate topLeft, Coordinate bottomRight) { 23 this(null, null, topLeft, bottomRight); 24 } 22 25 public MapRectangleImpl(String name, Coordinate topLeft, Coordinate bottomRight) { 23 26 this(null, name, topLeft, bottomRight);
Note:
See TracChangeset
for help on using the changeset viewer.