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
|
---|
9 | * version of a {@link org.openstreetmap.josm.data.osm.OsmPrimitive} in a {@link org.openstreetmap.josm.data.osm.history.History}.
|
---|
10 | *
|
---|
11 | * <ul>
|
---|
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>
|
---|
14 | * </ul>
|
---|
15 | *
|
---|
16 | */
|
---|
17 | public class TagInfoViewer extends HistoryViewerPanel {
|
---|
18 |
|
---|
19 | protected JTable buildReferenceTable() {
|
---|
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 |
|
---|
30 | protected JTable buildCurrentTable() {
|
---|
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 |
|
---|
41 | /**
|
---|
42 | * Constructs a new {@code TagInfoViewer}.
|
---|
43 | * @param model The history browsing model
|
---|
44 | */
|
---|
45 | public TagInfoViewer(HistoryBrowserModel model) {
|
---|
46 | super(model);
|
---|
47 | }
|
---|
48 | }
|
---|