Ignore:
Timestamp:
2009-10-04T00:37:05+02:00 (16 years ago)
Author:
stoecker
Message:

fixed #3649 - show node coordinates in history dialog

Location:
trunk/src/org/openstreetmap/josm/data/osm/history
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/history/History.java

    r2181 r2242  
    1010import java.util.List;
    1111import java.util.NoSuchElementException;
     12
     13import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    1214
    1315public class History{
     
    195197        return versions.isEmpty();
    196198    }
     199
     200    public OsmPrimitiveType getType() {
     201        if (isEmpty())
     202            throw new NoSuchElementException(tr("No type found. History is empty."));
     203        return versions.get(0).getType();
     204    }
    197205}
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java

    r1670 r2242  
    55
    66import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     7import org.openstreetmap.josm.data.coor.LatLon;
    78
    89
     
    1314 */
    1415public class HistoryNode extends HistoryOsmPrimitive {
    15     public HistoryNode(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp) {
     16    private LatLon coor;
     17    public HistoryNode(long id, long version, boolean visible, String user, long uid, long changesetId, Date timestamp,
     18    double lat, double lon) {
    1619        super(id, version, visible, user, uid, changesetId, timestamp);
     20        coor = new LatLon(lat, lon);
    1721    }
    1822
     
    2125        return OsmPrimitiveType.NODE;
    2226    }
     27
     28    public LatLon getCoordinate() {
     29        return coor;
     30    }
    2331}
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java

    r2181 r2242  
    3939    /**
    4040     * constructor
    41      * 
     41     *
    4242     * @param id the id (>0 required)
    4343     * @param version the version (> 0 required)
     
    4747     * @param changesetId the changeset id (> 0 required)
    4848     * @param timestamp the timestamp (! null required)
    49      * 
     49     *
    5050     * @throws IllegalArgumentException thrown if preconditions are violated
    5151     */
     
    5353        ensurePositiveLong(id, "id");
    5454        ensurePositiveLong(version, "version");
    55         ensurePositiveLong(uid, "uid");
     55        if(uid != -1) /* allow -1 for anonymous users */
     56            ensurePositiveLong(uid, "uid");
    5657        ensurePositiveLong(changesetId, "changesetId");
    5758        ensureNotNull(user, "user");
Note: See TracChangeset for help on using the changeset viewer.