Changeset 1925 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-08-08T08:52:03+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r1910 r1925 401 401 public void unlinkPrimitiveFromRelations(OsmPrimitive primitive) { 402 402 for (Relation relation : relations) { 403 Iterator<RelationMember> it = relation. members.iterator();403 Iterator<RelationMember> it = relation.getMembers().iterator(); 404 404 while(it.hasNext()) { 405 405 RelationMember member = it.next(); … … 442 442 continue; 443 443 } 444 for (RelationMember member: parent. members) {444 for (RelationMember member: parent.getMembers()) { 445 445 if (member.refersTo(child)) { 446 446 parents.add(parent); -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r1762 r1925 4 4 import static org.openstreetmap.josm.tools.I18n.trn; 5 5 6 import java.util.ArrayList; 6 7 import java.util.Arrays; 7 import java.util.ArrayList;8 8 import java.util.Collection; 9 9 import java.util.List; 10 10 11 import org.openstreetmap.josm.Main; 11 12 import org.openstreetmap.josm.data.osm.visitor.Visitor; 12 import org.openstreetmap.josm. Main;13 import org.openstreetmap.josm.tools.CopyList; 13 14 14 15 /** … … 24 25 */ 25 26 public final List<RelationMember> members = new ArrayList<RelationMember>(); 27 28 /** 29 * @return Members of the relation. Changes made in returned list are not mapped 30 * back to the primitive, use setMembers() to modify the members 31 * @since 1925 32 */ 33 public List<RelationMember> getMembers() { 34 return new CopyList<RelationMember>(members.toArray(new RelationMember[members.size()])); 35 } 36 37 /** 38 * 39 * @param members 40 * @since 1925 41 */ 42 public void setMembers(List<RelationMember> members) { 43 this.members.clear(); 44 this.members.addAll(members); 45 } 26 46 27 47 final static String[] defnames = {"name", "ref", "restriction", "note"}; … … 59 79 // we must not add the members themselves, but instead 60 80 // add clones of the members 61 for (RelationMember em : ((Relation)osm). members) {81 for (RelationMember em : ((Relation)osm).getMembers()) { 62 82 members.add(new RelationMember(em)); 63 83 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/AllNodesVisitor.java
r1523 r1925 5 5 import java.util.HashSet; 6 6 7 import org.openstreetmap.josm.data.osm.Node; 8 import org.openstreetmap.josm.data.osm.OsmPrimitive; 7 9 import org.openstreetmap.josm.data.osm.Relation; 8 10 import org.openstreetmap.josm.data.osm.RelationMember; 9 import org.openstreetmap.josm.data.osm.Node;10 import org.openstreetmap.josm.data.osm.OsmPrimitive;11 11 import org.openstreetmap.josm.data.osm.Way; 12 12 … … 43 43 */ 44 44 public void visit(Relation e) { 45 for (RelationMember m : e. members)45 for (RelationMember m : e.getMembers()) 46 46 if (m.member instanceof Node) visit((Node)m.member); 47 47 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r1724 r1925 5 5 import org.openstreetmap.josm.data.Bounds; 6 6 import org.openstreetmap.josm.data.ProjectionBounds; 7 import org.openstreetmap.josm.data.coor.CachedLatLon; 7 8 import org.openstreetmap.josm.data.coor.EastNorth; 8 import org.openstreetmap.josm.data.coor.CachedLatLon;9 9 import org.openstreetmap.josm.data.coor.LatLon; 10 10 import org.openstreetmap.josm.data.osm.Node; … … 33 33 public void visit(Relation e) { 34 34 // only use direct members 35 for (RelationMember m : e. members) {35 for (RelationMember m : e.getMembers()) { 36 36 if (!(m.member instanceof Relation)) { 37 37 m.member.visit(this); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/CollectBackReferencesVisitor.java
r1862 r1925 73 73 for (Relation r : ds.relations) { 74 74 if (r.incomplete || r.deleted) continue; 75 for (RelationMember m : r. members) {75 for (RelationMember m : r.getMembers()) { 76 76 if (m.member == p) { 77 77 if (!data.contains(r)) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1899 r1925 485 485 if(selectedCall) 486 486 { 487 for (RelationMember m : r. members)487 for (RelationMember m : r.getMembers()) 488 488 { 489 489 if (m.member != null && !m.member.incomplete && !m.member.deleted … … 507 507 if(r.isSelected()) /* draw ways*/ 508 508 { 509 for (RelationMember m : r. members)509 for (RelationMember m : r.getMembers()) 510 510 { 511 511 if (m.member != null && !m.member.incomplete && !m.member.deleted … … 532 532 533 533 /* find the "from", "via" and "to" elements */ 534 for (RelationMember m : r. members)534 for (RelationMember m : r.getMembers()) 535 535 { 536 536 //if(restrictionDebug) … … 782 782 r.clearErrors(); 783 783 784 for (RelationMember m : r. members)784 for (RelationMember m : r.getMembers()) 785 785 { 786 786 if(m.member == null) -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java
r1910 r1925 91 91 } 92 92 clone.members.clear(); 93 for (RelationMember member: r. members) {93 for (RelationMember member: r.getMembers()) { 94 94 RelationMember cloneMember = new RelationMember(member); 95 95 cloneMember.member = mappedPrimitives.get(member.member); … … 189 189 // 190 190 rememberRelationPartial(r); 191 for (RelationMember member: r. members) {191 for (RelationMember member: r.getMembers()) { 192 192 if (isAlreadyRemembered(member.member)) { 193 193 // referred primitive already remembered -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java
r1862 r1925 192 192 boolean replacedSomething = false; 193 193 LinkedList<RelationMember> newMembers = new LinkedList<RelationMember>(); 194 for (RelationMember myMember : r. members) {194 for (RelationMember myMember : r.getMembers()) { 195 195 OsmPrimitive mergedMember = merged.get(myMember.member); 196 196 if (mergedMember == null) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1899 r1925 348 348 g.setColor(col); 349 349 350 for (RelationMember m : r. members) {350 for (RelationMember m : r.getMembers()) { 351 351 if (m.member.incomplete || m.member.deleted) continue; 352 352
Note:
See TracChangeset
for help on using the changeset viewer.