Changeset 16460 in josm
- Timestamp:
- 2020-05-18T09:57:52+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
r16445 r16460 13 13 14 14 import org.openstreetmap.josm.data.osm.Changeset; 15 import org.openstreetmap.josm.data.osm.IPrimitive;16 15 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 17 16 import org.openstreetmap.josm.data.osm.PrimitiveId; … … 166 165 */ 167 166 public History getHistory(PrimitiveId pid) { 168 PrimitiveId key = pid instanceof IPrimitive ? ((IPrimitive) pid).getPrimitiveId() 169 : pid instanceof HistoryOsmPrimitive ? ((HistoryOsmPrimitive) pid).getPrimitiveId() 170 : pid; 167 PrimitiveId key = new SimplePrimitiveId(pid.getUniqueId(), pid.getType()); 171 168 List<HistoryOsmPrimitive> versions = data.get(Objects.requireNonNull(key, "key")); 172 169 if (versions == null) -
trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
r16459 r16460 56 56 table.addMouseListener(new ShowHistoryAction.DoubleClickAdapter(e -> { 57 57 int row = table.rowAtPoint(e.getPoint()); 58 return row < =0 ? null : primitiveIdAtRow(tableModel, row);58 return row < 0 ? null : primitiveIdAtRow(tableModel, row); 59 59 })); 60 60 return table; -
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java
r16459 r16460 38 38 table.addMouseListener(new ShowHistoryAction.DoubleClickAdapter(e -> { 39 39 int row = table.rowAtPoint(e.getPoint()); 40 return row < =0 ? null : (RelationMemberData) tableModel.getValueAt(row, 0).value;40 return row < 0 ? null : (RelationMemberData) tableModel.getValueAt(row, 0).value; 41 41 })); 42 42 return table; -
trunk/src/org/openstreetmap/josm/gui/history/ShowHistoryAction.java
r16459 r16460 7 7 import java.awt.event.MouseAdapter; 8 8 import java.awt.event.MouseEvent; 9 import java.util.Collections; 9 10 import java.util.function.Function; 10 11 … … 12 13 13 14 import org.openstreetmap.josm.data.osm.PrimitiveId; 14 import org.openstreetmap.josm.data.osm.history.History;15 import org.openstreetmap.josm.data.osm.history.HistoryDataSet;16 import org.openstreetmap.josm.gui.MainApplication;17 import org.openstreetmap.josm.gui.util.GuiHelper;18 15 import org.openstreetmap.josm.tools.ImageProvider; 19 16 20 17 /** 21 * Open a history browser with the history of this node18 * Open a history browser with the history of an object. 22 19 */ 23 20 class ShowHistoryAction extends AbstractAction { … … 29 26 ShowHistoryAction() { 30 27 putValue(NAME, tr("Show history")); 31 putValue(SHORT_DESCRIPTION, tr(" Open a history browser with the history of this node"));28 putValue(SHORT_DESCRIPTION, tr("Display the history of the selected object.")); 32 29 new ImageProvider("dialogs", "history").getResource().attachImageIcon(this, true); 33 30 } … … 46 43 47 44 public void run() { 48 if (HistoryDataSet.getInstance().getHistory(primitiveId) == null) { 49 MainApplication.worker.submit(new HistoryLoadTask().add(primitiveId)); 50 } 51 MainApplication.worker.submit(() -> { 52 final History h = HistoryDataSet.getInstance().getHistory(primitiveId); 53 if (h == null) 54 return; 55 GuiHelper.runInEDT(() -> HistoryBrowserDialogManager.getInstance().show(h)); 56 }); 45 HistoryBrowserDialogManager.getInstance().showHistory(Collections.singleton(primitiveId)); 57 46 } 58 47
Note:
See TracChangeset
for help on using the changeset viewer.