Changeset 5652 in josm
- Timestamp:
- 2012-12-31T00:05:34+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r5571 r5652 11 11 import java.awt.Stroke; 12 12 import java.awt.geom.GeneralPath; 13 import java.util.ArrayList; 14 import java.util.Arrays; 13 15 import java.util.Iterator; 16 import java.util.List; 14 17 15 18 import org.openstreetmap.josm.Main; … … 87 90 private static final double sinPHI = Math.sin(PHI); 88 91 89 /** Helper variable for {@link #visit(Relation) */92 /** Helper variable for {@link #visit(Relation)} */ 90 93 private Stroke relatedWayStroke = new BasicStroke( 91 94 4, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL); … … 155 158 this.ds = data; 156 159 getSettings(virtual); 157 158 /* draw tagged ways first, then untagged ways. takes 159 time to iterate through list twice, OTOH does not 160 require changing the colour while painting... */ 161 for (final OsmPrimitive osm: data.searchRelations(bbox)) { 162 if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) { 163 osm.visit(this); 164 } 165 } 166 167 for (final OsmPrimitive osm:data.searchWays(bbox)){ 168 if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && osm.isTagged()) { 169 osm.visit(this); 160 161 for (final Relation rel : data.searchRelations(bbox)) { 162 if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) { 163 rel.visit(this); 164 } 165 } 166 167 // draw tagged ways first, then untagged ways, then highlighted ways 168 List<Way> highlightedWays = new ArrayList<Way>(); 169 List<Way> untaggedWays = new ArrayList<Way>(); 170 171 for (final Way way : data.searchWays(bbox)){ 172 if (way.isDrawable() && !ds.isSelected(way) && !way.isDisabledAndHidden() && way.isTagged()) { 173 if (way.isHighlighted()) { 174 highlightedWays.add(way); 175 } else if (!way.isTagged()) { 176 untaggedWays.add(way); 177 } else { 178 way.visit(this); 179 } 170 180 } 171 181 } 172 182 displaySegments(); 173 174 for (final OsmPrimitive osm:data.searchWays(bbox)){ 175 if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && !osm.isTagged()) { 176 osm.visit(this); 177 } 178 } 179 displaySegments(); 183 184 // Display highlighted ways after the other ones (fix #8276) 185 for (List<Way> specialWays : Arrays.asList(new List[]{untaggedWays, highlightedWays})) { 186 for (final Way way : specialWays){ 187 way.visit(this); 188 } 189 specialWays.clear(); 190 displaySegments(); 191 } 192 180 193 for (final OsmPrimitive osm : data.getSelected()) { 181 194 if (osm.isDrawable()) {
Note:
See TracChangeset
for help on using the changeset viewer.