- Timestamp:
- 2009-05-30T17:24:29+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 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));
Note:
See TracChangeset
for help on using the changeset viewer.