Changeset 17903 in josm for trunk/src/org
- Timestamp:
- 2021-05-17T21:27:21+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/history/History.java
r17887 r17903 192 192 /** 193 193 * Replies the history primitive which changed the given key. 194 * @param version the version194 * @param primitive the reference primitive (the history up to and including this primitive is considered) 195 195 * @param key the OSM key 196 * @param isLatest whether this relates to a not yet committed changeset 196 197 * @return the history primitive which changed the given key 197 198 */ 198 public HistoryOsmPrimitive getWhichChangedTag(long version, String key) { 199 HistoryOsmPrimitive primitive = getByVersion(version); 199 public HistoryOsmPrimitive getWhichChangedTag(HistoryOsmPrimitive primitive, String key, boolean isLatest) { 200 200 if (primitive == null) { 201 201 return null; 202 } else if (isLatest && !Objects.equals(getLatest().get(key), primitive.get(key))) { 203 return primitive; 202 204 } 203 205 for (int i = versions.indexOf(primitive); i > 0; i--) { -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r17890 r17903 714 714 */ 715 715 public Color getVersionColor(HistoryOsmPrimitive primitive) { 716 return dateScale.getColor( primitive.getInstant().toEpochMilli());716 return dateScale.getColor(isLatest(primitive) ? System.currentTimeMillis() : primitive.getInstant().toEpochMilli()); 717 717 } 718 718 } -
trunk/src/org/openstreetmap/josm/gui/history/TagTableCellRenderer.java
r17890 r17903 63 63 HistoryOsmPrimitive primitive = model.getWhichChangedTag(key); 64 64 if (primitive != null) { 65 text = "v" + primitive.getVersion();65 text = model.getVersionString(primitive); 66 66 tooltip = tr("Key ''{0}'' was changed in version {1}", key, primitive.getVersion()); 67 67 setBorder(BorderFactory.createMatteBorder(0, 0, 0, 2, model.getVersionColor(primitive))); -
trunk/src/org/openstreetmap/josm/gui/history/TagTableModel.java
r17890 r17903 93 93 if (primitive == null) 94 94 return null; 95 return model.getHistory().getWhichChangedTag(primitive.getVersion(), key); 95 return model.getHistory().getWhichChangedTag(primitive, key, model.isLatest(primitive)); 96 } 97 98 /** 99 * Returns a version string for the given primitive, {@code "*"} if it is {@linkplain HistoryBrowserModel#isLatest is latest}. 100 * @param primitive the history primitive 101 * @return a version string for the given primitive 102 */ 103 public String getVersionString(HistoryOsmPrimitive primitive) { 104 return model.isLatest(primitive) ? "*" : "v" + primitive.getVersion(); 96 105 } 97 106
Note:
See TracChangeset
for help on using the changeset viewer.