Changeset 3671 in josm for trunk/src/org/openstreetmap/josm/data/validation/TestError.java
- Timestamp:
- 2010-11-25T09:45:38+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r3669 r3671 157 157 return null; 158 158 String type = "u"; 159 if (o instanceof Way) 159 if (o instanceof Way) { 160 160 type = "w"; 161 else if (o instanceof Relation)161 } else if (o instanceof Relation) { 162 162 type = "r"; 163 else if (o instanceof Node)163 } else if (o instanceof Node) { 164 164 type = "n"; 165 } 165 166 strings.add(type + "_" + o.getId()); 166 167 } … … 173 174 public String getIgnoreSubGroup() { 174 175 String ignorestring = getIgnoreGroup(); 175 if (description_en != null) 176 if (description_en != null) { 176 177 ignorestring += "_" + description_en; 178 } 177 179 return ignorestring; 178 180 } … … 216 218 217 219 /** 218 * Fixes the error with the approp iate command220 * Fixes the error with the appropriate command 219 221 * 220 222 * @return The command to fix the error … … 243 245 public void visitHighlighted(ValidatorVisitor v) { 244 246 for (Object o : highlighted) { 245 if (o instanceof OsmPrimitive) 247 if (o instanceof OsmPrimitive) { 246 248 v.visit((OsmPrimitive) o); 247 else if (o instanceof WaySegment)249 } else if (o instanceof WaySegment) { 248 250 v.visit((WaySegment) o); 249 else if (o instanceof List<?>) {251 } else if (o instanceof List<?>) { 250 252 v.visit((List<Node>)o); 251 253 } … … 273 275 } 274 276 277 @Override 275 278 public void visit(OsmPrimitive p) { 276 279 if (p.isUsable()) { … … 289 292 if (selected) { 290 293 g.fillOval(p.x - 5, p.y - 5, 10, 10); 291 } else 294 } else { 292 295 g.drawOval(p.x - 5, p.y - 5, 10, 10); 296 } 293 297 } 294 298 … … 301 305 int deg = (int) Math.toDegrees(t); 302 306 if (selected) { 303 int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT), (int) (p2.x - 5 * cosT),304 (int) (p1.x - 5 * cosT) };305 int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT), (int) (p2.y + 5 * sinT),306 (int) (p1.y + 5 * sinT) };307 int[] x = new int[] { (int) (p1.x + 5 * cosT), (int) (p2.x + 5 * cosT), 308 (int) (p2.x - 5 * cosT), (int) (p1.x - 5 * cosT) }; 309 int[] y = new int[] { (int) (p1.y - 5 * sinT), (int) (p2.y - 5 * sinT), 310 (int) (p2.y + 5 * sinT), (int) (p1.y + 5 * sinT) }; 307 311 g.fillPolygon(x, y, 4); 308 312 g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); 309 313 g.fillArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180); 310 314 } else { 311 g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT), (int) (p2.x + 5 * cosT),312 (int) (p2.y - 5 * sinT));313 g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT), (int) (p2.x - 5 * cosT),314 (int) (p2.y + 5 * sinT));315 g.drawLine((int) (p1.x + 5 * cosT), (int) (p1.y - 5 * sinT), 316 (int) (p2.x + 5 * cosT), (int) (p2.y - 5 * sinT)); 317 g.drawLine((int) (p1.x - 5 * cosT), (int) (p1.y + 5 * sinT), 318 (int) (p2.x - 5 * cosT), (int) (p2.y + 5 * sinT)); 315 319 g.drawArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); 316 320 g.drawArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180); … … 334 338 * @param n The node to draw. 335 339 */ 340 @Override 336 341 public void visit(Node n) { 337 if (isNodeVisible(n)) 342 if (isNodeVisible(n)) { 338 343 drawNode(n, severity.getColor()); 339 } 340 344 } 345 } 346 347 @Override 341 348 public void visit(Way w) { 342 349 visit(w.getNodes()); 343 350 } 344 351 352 @Override 345 353 public void visit(WaySegment ws) { 346 354 if (ws.lowerIndex < 0 || ws.lowerIndex + 1 >= ws.way.getNodesCount()) … … 352 360 } 353 361 362 @Override 354 363 public void visit(Relation r) { 355 364 /* No idea how to draw a relation. */ … … 387 396 } 388 397 398 @Override 389 399 public void visit(List<Node> nodes) { 390 400 Node lastN = null;
Note:
See TracChangeset
for help on using the changeset viewer.