Changeset 857 in josm
- Timestamp:
- 2008-08-24T14:32:24+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/visitor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r855 r857 157 157 if(w.selected) 158 158 { 159 if(showDirection || virtualNodeSize != 0)160 drawSeg(lastN, n, selectedColor, showDirection, width, false, false);159 if(showDirection) 160 drawSeg(lastN, n, selectedColor, showDirection, width, dashed, false); 161 161 } 162 162 else 163 drawSeg(lastN, n, untaggedColor, showDirection, width, dashed, true);163 drawSeg(lastN, n, colour, showDirection, width, dashed, true); 164 164 } 165 165 else 166 drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, true, true);166 drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, dashed, true); 167 167 } else { 168 168 if (realWidth > 0 && useRealWidth && !showDirection) { … … 244 244 return; 245 245 } 246 drawVirtualNode(p1, p2, col);247 246 if(drawway) 248 247 { … … 340 339 if (!osm.incomplete && !osm.deleted) 341 340 osm.visit(this); 341 342 if(virtualNodeSize != 0) 343 { 344 currentColor = nodeColor; 345 for (final OsmPrimitive osm : data.ways) 346 if (!osm.deleted) 347 visitVirtual((Way)osm); 348 displaySegments(null); 349 } 342 350 } 343 351 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r856 r857 134 134 displaySegments(null); 135 135 136 for (final OsmPrimitive osm : data.getSelected()) 137 if (!osm.deleted) 138 osm.visit(this); 139 displaySegments(null); 140 136 141 for (final OsmPrimitive osm : data.nodes) 137 142 if (!osm.deleted && !osm.selected) 138 143 osm.visit(this); 139 140 for (final OsmPrimitive osm : data.getSelected()) 141 if (!osm.deleted) 142 osm.visit(this); 143 displaySegments(null); 144 if(virtualNodeSize != 0) 145 { 146 currentColor = nodeColor; 147 for (final OsmPrimitive osm : data.ways) 148 if (!osm.deleted) 149 visitVirtual((Way)osm); 150 displaySegments(null); 151 } 144 152 } 145 153 … … 161 169 else 162 170 drawNode(n, nodeColor, unselectedNodeSize, unselectedNodeRadius, fillUnselectedNode); 171 } 172 173 public void visitVirtual(Way w) { 174 Iterator<Node> it = w.nodes.iterator(); 175 if (it.hasNext()) { 176 Point lastP = nc.getPoint(it.next().eastNorth); 177 while(it.hasNext()) 178 { 179 Point p = nc.getPoint(it.next().eastNorth); 180 if(isSegmentVisible(lastP, p)) 181 { 182 int xd = p.x-lastP.x; if(xd < 0) xd = -xd; 183 int yd = p.y-lastP.y; if(yd < 0) yd = -yd; 184 if(xd+yd > virtualNodeSpace) 185 { 186 int x = (p.x+lastP.x)/2; 187 int y = (p.y+lastP.y)/2; 188 currentPath.moveTo(x-5, y); 189 currentPath.lineTo(x+5, y); 190 currentPath.moveTo(x, y-5); 191 currentPath.lineTo(x, y+5); 192 } 193 } 194 lastP = p; 195 } 196 } 163 197 } 164 198 … … 282 316 } 283 317 284 protected void drawVirtualNode(Point p1, Point p2, Color col)285 {286 if(virtualNodeSize > 0)287 {288 int xd = p2.x-p1.x; if(xd < 0) xd = -xd;289 int yd = p2.y-p1.y; if(yd < 0) yd = -yd;290 if(xd+yd > virtualNodeSpace)291 {292 int x = (p1.x+p2.x)/2;293 int y = (p1.y+p2.y)/2;294 currentPath.moveTo(x-5, y);295 currentPath.lineTo(x+5, y);296 currentPath.moveTo(x, y-5);297 currentPath.lineTo(x, y+5);298 }299 }300 }301 302 318 /** 303 319 * Draw a line with the given color. … … 308 324 309 325 if (isSegmentVisible(p1, p2)) { 310 drawVirtualNode(p1, p2, col);311 312 326 currentPath.moveTo(p1.x, p1.y); 313 327 currentPath.lineTo(p2.x, p2.y);
Note:
See TracChangeset
for help on using the changeset viewer.