Changeset 1618 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-05-24T12:53:58+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r1616 r1618 338 338 RelationMember em = clone.members.get(i); 339 339 boolean linked = false; 340 Node n1 = null;341 Node n2 = null;342 340 RelationMember m = em; 341 RelationMember way1 = null; 342 RelationMember way2 = null; 343 343 while (m != null) { 344 344 if (m.member instanceof Way) { 345 n1 = ((Way) m.member).lastNode();345 way1 = m; 346 346 break; 347 347 } else if (m.member instanceof Relation) { … … 351 351 } 352 352 } 353 if (i<clone.members.size()-1) { 354 m = clone.members.get(i+1); 355 while (m != null) { 356 if (m.member instanceof Way) { 357 n2 = ((Way) (m.member)).firstNode(); 353 if (way1 != null) { 354 int next = i+1; 355 while (next < clone.members.size()) { 356 m = clone.members.get(next++); 357 while (m != null) { 358 if (m.member instanceof Way) { 359 way2 = m; 360 break; 361 } else if (m.member instanceof Relation) { 362 m = ((Relation)(m.member)).firstMember(); 363 } else { 364 break; 365 } 366 } 367 if (way2 != null) 358 368 break; 359 } else if (m.member instanceof Relation) { 360 m = ((Relation)(m.member)).firstMember(); 361 } else { 362 break; 363 } 364 } 365 } 366 linked = (n1 != null) && n1.equals(n2); 367 368 // end of section to determine linkedness. 369 370 memberData.addRow(new Object[]{em.role, em.member, linked ? tr("yes") : tr("no")}); 369 } 370 } 371 if (way2 != null) { 372 Node way1first = ((Way)(way1.member)).firstNode(); 373 Node way1last = ((Way)(way1.member)).lastNode(); 374 Node way2first = ((Way)(way2.member)).firstNode(); 375 Node way2last = ((Way)(way2.member)).lastNode(); 376 if (way1.role.equals("forward")) { 377 way1first = null; 378 } else if (way1.role.equals("backward")) { 379 way1last = null; 380 } 381 if (way2.role.equals("forward")) { 382 way2last = null; 383 } else if (way2.role.equals("backward")) { 384 way2first = null; 385 } 386 387 if (way1first != null && way2first != null && way1first.equals(way2first)) { 388 linked = true; 389 } else if (way1first != null && way2last != null && way1first.equals(way2last)) { 390 linked = true; 391 } else if (way1last != null && way2first != null && way1last.equals(way2first)) { 392 linked = true; 393 } else if (way1last != null && way2last != null && way1last.equals(way2last)) { 394 linked = true; 395 } 396 397 // end of section to determine linkedness. 398 399 memberData.addRow(new Object[]{em.role, em.member, linked ? tr("yes") : tr("no")}); 400 } else { 401 memberData.addRow(new Object[]{em.role, em.member, ""}); 402 } 371 403 } 372 404 status.setText(tr("Members: {0}", clone.members.size()));
Note:
See TracChangeset
for help on using the changeset viewer.