Changeset 1629 in josm
- Timestamp:
- 2009-05-30T17:24:29+02:00 (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1553 r1629 223 223 else if (wayStyle instanceof AreaElemStyle) 224 224 { 225 AreaElemStyle areaStyle = (AreaElemStyle) wayStyle; 225 226 /* way with area style */ 226 227 //if(!profilerOmitDraw) 227 228 //{ 228 if (fillAreas > dist )229 if (fillAreas > dist && (!areaStyle.closed || w.isClosed())) 229 230 { 230 231 // profilerVisibleAreas++; 231 drawArea(w, w.selected ? selectedColor : ((AreaElemStyle)wayStyle).color);232 drawArea(w, w.selected ? selectedColor : areaStyle.color); 232 233 if(!w.isClosed()) 233 234 w.putError(tr("Area style way is not closed."), true); 234 235 } 235 drawWay(w, ((AreaElemStyle)wayStyle).line, ((AreaElemStyle)wayStyle).color, w.selected);236 drawWay(w, areaStyle.line, areaStyle.color, w.selected); 236 237 //} 237 238 } … … 456 457 if(style instanceof AreaElemStyle) 457 458 { 458 drawWay((Way)osm, ((AreaElemStyle)style).line, selectedColor, true); 459 if(area) 460 drawArea((Way)osm, areaselected ? selectedColor 461 : ((AreaElemStyle)style).color); 459 Way way = (Way)osm; 460 AreaElemStyle areaStyle = (AreaElemStyle)style; 461 drawWay(way, areaStyle.line, selectedColor, true); 462 if(area && (!areaStyle.closed || way.isClosed())) 463 drawArea(way, areaselected ? selectedColor : areaStyle.color); 462 464 } 463 465 else … … 907 909 inner.add(p); 908 910 } 911 public boolean isClosed() 912 { 913 return (poly.npoints >= 3 914 && poly.xpoints[0] == poly.xpoints[poly.npoints-1] 915 && poly.ypoints[0] == poly.ypoints[poly.npoints-1]); 916 } 909 917 public Polygon get() 910 918 { … … 967 975 o.addInner(polygon); 968 976 } 977 AreaElemStyle areaStyle = (AreaElemStyle)wayStyle; 969 978 for (PolyData pd : poly) 970 979 { 971 if(isPolygonVisible(pd.get())) 972 { 973 drawAreaPolygon(pd.get(), (pd.way.selected || r.selected) ? selectedColor 974 : ((AreaElemStyle)wayStyle).color); 980 Polygon p = pd.get(); 981 if(isPolygonVisible(p) && (!areaStyle.closed || pd.isClosed())) 982 { 983 drawAreaPolygon(p, (pd.way.selected || r.selected) ? selectedColor 984 : areaStyle.color); 975 985 visible = true; 976 986 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r1204 r1629 5 5 { 6 6 public Color color; 7 public boolean closed; 7 8 public LineElemStyle line = null; 8 9 9 10 public AreaElemStyle (AreaElemStyle a, long maxScale, long minScale) { 10 11 this.color = a.color; 12 this.closed = a.closed; 11 13 this.priority = a.priority; 12 14 this.maxScale = maxScale; … … 17 19 { 18 20 this.color = a.color; 21 this.closed = a.closed; 19 22 this.priority = a.priority; 20 23 this.maxScale = a.maxScale; -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r1583 r1629 73 73 System.out.println(styleName + " (" + rule.key + "=" + rule.value + "): " + message); 74 74 } 75 75 76 76 private void startElementLine(String qName, Attributes atts, LineElemStyle line) { 77 77 for (int count=0; count<atts.getLength(); count++) … … 110 110 if(dashed) { 111 111 line.dashed = 9; 112 } 112 } 113 113 } 114 114 } else if (atts.getQName(count).equals("dashedcolour")) … … 194 194 if (atts.getQName(count).equals("colour")) 195 195 rule.area.color=convertColor(atts.getValue(count)); 196 else if (atts.getQName(count).equals("closed")) 197 rule.area.closed=Boolean.parseBoolean(atts.getValue(count)); 196 198 else if(atts.getQName(count).equals("priority")) 197 199 rule.area.priority = Integer.parseInt(atts.getValue(count)); -
trunk/styles/standard/elemstyles.xml
r1556 r1629 26 26 - colour 27 27 - priority 28 - closed (true or false - when true the area style is ignored for unclosed ways) 28 29 6. icon attributes 29 30 - icon path to icon, relative to the icon path (default: subdirectory icons in 30 31 directory where this file is) 31 32 - priority 33 - annonate (true or false) 32 34 7. scale_min / scale_max 33 35 - zoom scale for display … … 353 355 <condition k="barrier" v="bollard"/> 354 356 <icon annotate="true" src="vehicle/restriction/bollard.png"/> 355 <line width="3" colour="barrier#F0F050"/>357 <line width="3" colour="barrier#F0F050" closed="true"/> 356 358 <scale_min>1</scale_min> 357 359 <scale_max>50000</scale_max> … … 366 368 <condition k="barrier" v="hedge"/> 367 369 <icon annotate="true" src="misc/deprecated.png"/> 368 369 <area colour="barrier#F0F050"/>370 <line width="3" colour="barrier#F0F050"/> 371 <area colour="barrier#F0F050" closed="true"/> 370 372 <scale_min>1</scale_min> 371 373 <scale_max>50000</scale_max> … … 380 382 <condition k="barrier" v="fence"/> 381 383 <icon annotate="true" src="misc/deprecated.png"/> 382 383 <area colour="barrier#F0F050"/>384 <line width="3" colour="barrier#F0F050"/> 385 <area colour="barrier#F0F050" closed="true"/> 384 386 <scale_min>1</scale_min> 385 387 <scale_max>50000</scale_max> … … 400 402 <condition k="barrier" v="wall"/> 401 403 <icon annotate="true" src="misc/deprecated.png"/> 402 403 <area colour="barrier#F0F050"/>404 <line width="3" colour="barrier#F0F050"/> 405 <area colour="barrier#F0F050" closed="true"/> 404 406 <scale_min>1</scale_min> 405 407 <scale_max>50000</scale_max> … … 408 410 <condition k="barrier" v="toll_booth"/> 409 411 <icon annotate="true" src="vehicle/toll_booth.png"/> 410 <area colour="barrier#F0F050"/>412 <area colour="barrier#F0F050" closed="true"/> 411 413 <scale_min>1</scale_min> 412 414 <scale_max>50000</scale_max> … … 421 423 <condition k="barrier" v="city_wall"/> 422 424 <icon annotate="true" src="misc/deprecated.png"/> 423 424 <area colour="barrier#F0F050"/>425 <line width="3" colour="barrier#F0F050"/> 426 <area colour="barrier#F0F050" closed="true"/> 425 427 <scale_min>1</scale_min> 426 428 <scale_max>50000</scale_max> … … 435 437 <condition k="barrier" v="retaining_wall"/> 436 438 <icon annotate="true" src="misc/deprecated.png"/> 437 438 <area colour="barrier#F0F050"/>439 <line width="3" colour="barrier#F0F050"/> 440 <area colour="barrier#F0F050" closed="true"/> 439 441 <scale_min>1</scale_min> 440 442 <scale_max>50000</scale_max> … … 449 451 <condition k="barrier" v="block"/> 450 452 <icon annotate="true" src="misc/no_icon.png"/> 451 452 <area colour="barrier#F0F050"/>453 <line width="3" colour="barrier#F0F050"/> 454 <area colour="barrier#F0F050" closed="true"/> 453 455 <scale_min>1</scale_min> 454 456 <scale_max>50000</scale_max> … … 668 670 <condition k="highway" v="pedestrian"/> 669 671 <line width="3" realwidth="5" colour="foot#00ff00"/> 670 <!-- seems to be common to use area=yes for areas here --> 671 <!-- some people seem to have problems that polylines displayed as areas, so comment this out --> 672 <!--<area colour="foot#00ff00"/>--> 672 <area colour="foot#00ff00" closed="true"/> 673 673 <icon annotate="true" src="misc/deprecated.png"/> 674 674 <scale_min>1</scale_min> … … 849 849 <rule> 850 850 <condition k="junction" v="roundabout"/> 851 <area colour="roundabout#eeeeee" />851 <area colour="roundabout#eeeeee" closed="true"/> 852 852 <!-- tagging a node makes no real sense, a roundabout should be tagged with several nodes, or a highway=mini_roundabout should probably be used --> 853 853 <icon annotate="true" src="misc/deprecated.png"/> … … 1218 1218 <icon annotate="true" src="misc/deprecated.png"/> 1219 1219 <line width="2" colour="rail#404040"/> 1220 <area colour="rail#404040" />1220 <area colour="rail#404040" closed="true"/> 1221 1221 <scale_min>1</scale_min> 1222 1222 <scale_max>50000</scale_max> … … 1527 1527 <rule> 1528 1528 <condition k="man_made" v="pier"/> 1529 <!-- seems to be common to use area=yes for areas here --> 1530 <!-- some people seem to have problems that polylines displayed as areas, so comment this out --> 1531 <!--<area colour="pier#660000"/>--> 1529 <area colour="pier#660000" closed="true"/> 1532 1530 <line width="2" colour="pier#660000"/> 1533 1531 <icon annotate="true" src="nautical/pier.png"/> … … 3267 3265 <icon src="misc/no_icon.png"/> 3268 3266 <line width="2" colour="natural#002f00"/> 3269 <area colour="natural#002f00" />3267 <area colour="natural#002f00" closed="true"/> 3270 3268 <scale_min>1</scale_min> 3271 3269 <scale_max>50000</scale_max>
Note:
See TracChangeset
for help on using the changeset viewer.