[2512] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.gui.history;
|
---|
| 3 |
|
---|
| 4 | import javax.swing.JTable;
|
---|
| 5 | import javax.swing.ListSelectionModel;
|
---|
| 6 |
|
---|
| 7 | /**
|
---|
| 8 | * TagInfoViewer is a UI component which displays the list of tags of two
|
---|
[5832] | 9 | * version of a {@link org.openstreetmap.josm.data.osm.OsmPrimitive} in a {@link org.openstreetmap.josm.data.osm.history.History}.
|
---|
[2512] | 10 | *
|
---|
| 11 | * <ul>
|
---|
[5266] | 12 | * <li>on the left, it displays the list of tags for the version at {@link PointInTimeType#REFERENCE_POINT_IN_TIME}</li>
|
---|
| 13 | * <li>on the right, it displays the list of tags for the version at {@link PointInTimeType#CURRENT_POINT_IN_TIME}</li>
|
---|
[2512] | 14 | * </ul>
|
---|
| 15 | *
|
---|
| 16 | */
|
---|
[6207] | 17 | public class TagInfoViewer extends HistoryViewerPanel {
|
---|
[2512] | 18 |
|
---|
[6207] | 19 | protected JTable buildReferenceTable() {
|
---|
[2512] | 20 | JTable table = new JTable(
|
---|
| 21 | model.getTagTableModel(PointInTimeType.REFERENCE_POINT_IN_TIME),
|
---|
| 22 | new TagTableColumnModel()
|
---|
| 23 | );
|
---|
| 24 | table.setName("table.referencetagtable");
|
---|
| 25 | table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
---|
| 26 | selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
|
---|
| 27 | return table;
|
---|
| 28 | }
|
---|
| 29 |
|
---|
[6207] | 30 | protected JTable buildCurrentTable() {
|
---|
[2512] | 31 | JTable table = new JTable(
|
---|
| 32 | model.getTagTableModel(PointInTimeType.CURRENT_POINT_IN_TIME),
|
---|
| 33 | new TagTableColumnModel()
|
---|
| 34 | );
|
---|
| 35 | table.setName("table.currenttagtable");
|
---|
| 36 | table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
---|
| 37 | selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
|
---|
| 38 | return table;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
[6207] | 41 | /**
|
---|
| 42 | * Constructs a new {@code TagInfoViewer}.
|
---|
| 43 | * @param model The history browsing model
|
---|
| 44 | */
|
---|
[2512] | 45 | public TagInfoViewer(HistoryBrowserModel model) {
|
---|
[6207] | 46 | super(model);
|
---|
[2512] | 47 | }
|
---|
| 48 | }
|
---|