Changeset 16683 in osm
- Timestamp:
- 2009-07-25T10:49:12+02:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/routes
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java
r16594 r16683 11 11 12 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.data.osm.DataSet; 13 14 import org.openstreetmap.josm.data.osm.Relation; 14 15 import org.openstreetmap.josm.data.osm.RelationMember; … … 30 31 private final PathBuilder pathBuilder = new PathBuilder(); 31 32 private final List<RouteDefinition> routes = new ArrayList<RouteDefinition>(); 32 33 33 34 public RouteLayer(RoutesXMLLayer xmlLayer) { 34 35 super(xmlLayer.getName()); 35 36 36 37 int index = 0; 37 for (RoutesXMLRoute route:xmlLayer.getRoute()) { 38 for (RoutesXMLRoute route:xmlLayer.getRoute()) { 38 39 if (route.isEnabled()) { 39 40 Color color = ColorHelper.html2color(route.getColor()); … … 45 46 } 46 47 } 47 48 48 49 if ("wide".equals(Main.pref.get("routes.painter"))) { 49 50 pathPainter = new WideLinePainter(this); … … 80 81 @Override 81 82 public void mergeFrom(Layer from) { 82 83 // Merging is not supported 83 84 } 84 85 … … 89 90 pathBuilder.addWay(way, route); 90 91 } 91 } 92 } 92 93 } 93 94 … … 95 96 public void paint(Graphics g, MapView mv) { 96 97 98 DataSet dataset = Main.main.getCurrentDataSet(); 99 100 if (dataset == null) { 101 return; 102 } 103 97 104 pathBuilder.clear(); 98 105 99 for (Relation relation: Main.main.getCurrentDataSet().relations) {106 for (Relation relation:dataset.relations) { 100 107 for (RouteDefinition route:routes) { 101 108 if (route.matches(relation)) { 102 109 addRelation(relation, route); 103 110 } 104 } 111 } 105 112 } 106 113 107 for (Way way: Main.main.getCurrentDataSet().ways) {114 for (Way way:dataset.ways) { 108 115 for (RouteDefinition route:routes) { 109 116 if (route.matches(way)) { … … 122 129 123 130 } 124 131 125 132 public List<RouteDefinition> getRoutes() { 126 133 return routes;
Note:
See TracChangeset
for help on using the changeset viewer.