- Timestamp:
- 2009-08-08T11:32:27+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r1925 r1928 319 319 for(Way wayToAdd : newWays) 320 320 { 321 RelationMember em = new RelationMember(); 322 em.member = wayToAdd; 323 em.role = rm.role; 321 RelationMember em = new RelationMember(rm.role, wayToAdd); 324 322 if(em.role != null && em.role.length() > 0 && !("multipolygon".equals(type))) { 325 323 warnmerole = true; -
trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java
r1856 r1928 15 15 /** 16 16 * Default constructor. Does nothing. 17 * @deprecated Use other constructors because RelationMember class will became immutable 18 * in the future 17 19 */ 20 @Deprecated 18 21 public RelationMember() { } 19 22 … … 38 41 /** 39 42 * Replies true, if this relation member refers to the primitive 40 * 43 * 41 44 * @param primitive the primitive to check 42 45 * @return true, if this relation member refers to the primitive -
trunk/src/org/openstreetmap/josm/gui/conflict/relation/RelationMemberListMergeModel.java
r1925 r1928 100 100 @Override 101 101 protected RelationMember cloneEntryForMergedList(RelationMember entry) { 102 RelationMember member = new RelationMember(); 103 member.role = entry.role; 104 member.member = entry.member; 105 return member; 102 return new RelationMember(entry.role, entry.member); 106 103 } 107 104 -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r1925 r1928 595 595 if (rm.member == osm) 596 596 { 597 RelationMember mem = new RelationMember(); 598 mem.role = rm.role; 599 mem.member = rm.member; 597 RelationMember mem = new RelationMember(rm.role, rm.member); 600 598 rel.members.remove(mem); 601 599 break; -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r1924 r1928 122 122 public String type; 123 123 public long id; 124 public RelationMember relationMember;124 public String role; 125 125 } 126 126 … … 204 204 throw new SAXException(tr("Found <member> element in non-relation.")); 205 205 RelationMemberData emd = new RelationMemberData(); 206 emd.relationMember = new RelationMember();207 206 String value = atts.getValue("ref"); 208 207 if (value == null) … … 220 219 emd.type= value; 221 220 value = atts.getValue("role"); 222 emd.r elationMember.role = value;221 emd.role = value; 223 222 224 223 if (emd.id == 0) … … 393 392 * and populate them later. 394 393 */ 395 private void createRelations() {394 private void createRelations() throws SAXException { 396 395 397 396 // pass 1 - create all relations … … 414 413 415 414 for (RelationMemberData emd : e.getValue()) { 416 RelationMember em = emd.relationMember;415 OsmPrimitive member; 417 416 if (emd.type.equals("node")) { 418 em.member = findNode(emd.id);419 if ( em.member == null) {420 em.member = new Node(emd.id);421 ds.addPrimitive( em.member);417 member = findNode(emd.id); 418 if (member == null) { 419 member = new Node(emd.id); 420 ds.addPrimitive(member); 422 421 } 423 422 } else if (emd.type.equals("way")) { 424 em.member = hm.get(emd.id);425 if ( em.member == null) {426 em.member = findWay(emd.id);427 } 428 if ( em.member == null) {429 em.member = new Way(emd.id);430 ds.addPrimitive( em.member);423 member = hm.get(emd.id); 424 if (member == null) { 425 member = findWay(emd.id); 426 } 427 if (member == null) { 428 member = new Way(emd.id); 429 ds.addPrimitive(member); 431 430 } 432 431 } else if (emd.type.equals("relation")) { 433 em.member = findRelation(emd.id);434 if ( em.member == null) {435 em.member = new Relation(emd.id);436 ds.addPrimitive( em.member);432 member = findRelation(emd.id); 433 if (member == null) { 434 member = new Relation(emd.id); 435 ds.addPrimitive(member); 437 436 } 438 437 } else { 439 // this is an error.438 throw new SAXException(tr("Unknown relation member type {0}", emd.type)); 440 439 } 441 en.members.add( em);440 en.members.add(new RelationMember(emd.role, member)); 442 441 } 443 442 }
Note:
See TracChangeset
for help on using the changeset viewer.