Changeset 4602 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 20.11.2011 20:47:15 (6 months ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 6 edited
-
User.java (modified) (4 diffs)
-
history/History.java (modified) (1 diff)
-
history/HistoryNode.java (modified) (2 diffs)
-
history/HistoryOsmPrimitive.java (modified) (6 diffs)
-
history/HistoryRelation.java (modified) (3 diffs)
-
history/HistoryWay.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/User.java
r4601 r4602 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.data.osm; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.io.BufferedReader; … … 35 37 private static HashSet<Long> relicensingUsers = null; 36 38 private static HashSet<Long> nonRelicensingUsers = null; 39 private final static User anonymous = createLocalUser(tr("<anonymous>")); 37 40 38 41 private static long getNextLocalUid() { … … 110 113 } 111 114 return ret; 115 } 116 117 public static User getAnonymous() { 118 return anonymous; 112 119 } 113 120 … … 185 192 public static final int STATUS_ANONYMOUS = 4; 186 193 187 /** 194 /** 188 195 * Finds out this user's relicensing status and saves it for quicker 189 196 * access. -
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r3083 r4602 156 156 new FilterPredicate() { 157 157 public boolean matches(HistoryOsmPrimitive primitive) { 158 return primitive.getU id() == uid;158 return primitive.getUser() != null && primitive.getUser().getId() == uid; 159 159 } 160 160 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r4339 r4602 7 7 import org.openstreetmap.josm.data.osm.Node; 8 8 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 9 import org.openstreetmap.josm.data.osm.User; 9 10 10 11 /** … … 18 19 private LatLon coords; 19 20 20 public HistoryNode(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp, LatLon coords) {21 super(id, version, visible, user, uid,changesetId, timestamp);21 public HistoryNode(long id, long version, boolean visible, User user, long changesetId, Date timestamp, LatLon coords) { 22 super(id, version, visible, user, changesetId, timestamp); 22 23 setCoords(coords); 23 24 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r4339 r4602 17 17 import org.openstreetmap.josm.data.osm.Relation; 18 18 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 19 import org.openstreetmap.josm.data.osm.User; 19 20 import org.openstreetmap.josm.data.osm.Way; 20 21 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 29 30 private long id; 30 31 private boolean visible; 31 private String user; 32 private long uid; 32 private User user; 33 33 private long changesetId; 34 34 private Date timestamp; … … 54 54 * @throws IllegalArgumentException thrown if preconditions are violated 55 55 */ 56 public HistoryOsmPrimitive(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp) throws IllegalArgumentException {56 public HistoryOsmPrimitive(long id, long version, boolean visible, User user, long changesetId, Date timestamp) throws IllegalArgumentException { 57 57 ensurePositiveLong(id, "id"); 58 58 ensurePositiveLong(version, "version"); 59 if(uid != -1) {60 ensurePositiveLong(uid, "uid");61 }62 59 CheckParameterUtil.ensureParameterNotNull(user, "user"); 63 60 CheckParameterUtil.ensureParameterNotNull(timestamp, "timestamp"); … … 66 63 this.visible = visible; 67 64 this.user = user; 68 this.uid = uid;69 65 // FIXME: restrict to IDs > 0 as soon as OsmPrimitive holds the 70 66 // changeset id too … … 76 72 public HistoryOsmPrimitive(OsmPrimitive p) { 77 73 this(p.getId(), p.getVersion(), p.isVisible(), 78 p.getUser() == null ? null : p.getUser().getName(), 79 p.getUser() == null ? 0 : p.getUser().getId(), 74 p.getUser(), 80 75 p.getChangesetId(), p.getTimestamp()); 81 76 } … … 104 99 return visible; 105 100 } 106 public StringgetUser() {101 public User getUser() { 107 102 return user; 108 }109 public long getUid() {110 return uid;111 103 } 112 104 public long getChangesetId() { -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r4339 r4602 10 10 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 11 11 import org.openstreetmap.josm.data.osm.Relation; 12 import org.openstreetmap.josm.data.osm.User; 12 13 import org.openstreetmap.josm.tools.CheckParameterUtil; 13 14 … … 34 35 * @throws IllegalArgumentException thrown if preconditions are violated 35 36 */ 36 public HistoryRelation(long id, long version, boolean visible, String user, long uid, long changesetId,37 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, 37 38 Date timestamp) throws IllegalArgumentException { 38 super(id, version, visible, user, uid,changesetId, timestamp);39 super(id, version, visible, user, changesetId, timestamp); 39 40 } 40 41 /** … … 52 53 * @throws IllegalArgumentException thrown if preconditions are violated 53 54 */ 54 public HistoryRelation(long id, long version, boolean visible, String user, long uid, long changesetId,55 public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, 55 56 Date timestamp, ArrayList<RelationMember> members) { 56 this(id, version, visible, user, uid,changesetId, timestamp);57 this(id, version, visible, user, changesetId, timestamp); 57 58 if (members != null) { 58 59 this.members.addAll(members); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r4339 r4602 10 10 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 12 import org.openstreetmap.josm.data.osm.User; 12 13 import org.openstreetmap.josm.data.osm.Way; 14 13 15 /** 14 16 * Represents an immutable OSM way in the context of a historical view on … … 20 22 private ArrayList<Long> nodeIds = new ArrayList<Long>(); 21 23 22 public HistoryWay(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp) {23 super(id, version, visible, user, uid,changesetId, timestamp);24 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Date timestamp) { 25 super(id, version, visible, user, changesetId, timestamp); 24 26 } 25 27 26 public HistoryWay(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp, ArrayList<Long> nodeIdList) {27 this(id, version, visible, user, uid,changesetId, timestamp);28 public HistoryWay(long id, long version, boolean visible, User user, long changesetId, Date timestamp, ArrayList<Long> nodeIdList) { 29 this(id, version, visible, user, changesetId, timestamp); 28 30 this.nodeIds.addAll(nodeIdList); 29 31 }
Note: See TracChangeset
for help on using the changeset viewer.
