source: josm/trunk/src/org/openstreetmap/josm/gui/history/TagInfoViewer.java@ 8219

Last change on this file since 8219 was 7801, checked in by Don-vip, 9 years ago

fix some Sonar issues

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.history;
3
4import javax.swing.JTable;
5import 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 */
17public class TagInfoViewer extends HistoryViewerPanel {
18
19 @Override
20 protected JTable buildReferenceTable() {
21 JTable table = new JTable(
22 model.getTagTableModel(PointInTimeType.REFERENCE_POINT_IN_TIME),
23 new TagTableColumnModel()
24 );
25 table.setName("table.referencetagtable");
26 table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
27 selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
28 return table;
29 }
30
31 @Override
32 protected JTable buildCurrentTable() {
33 JTable table = new JTable(
34 model.getTagTableModel(PointInTimeType.CURRENT_POINT_IN_TIME),
35 new TagTableColumnModel()
36 );
37 table.setName("table.currenttagtable");
38 table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
39 selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
40 return table;
41 }
42
43 /**
44 * Constructs a new {@code TagInfoViewer}.
45 * @param model The history browsing model
46 */
47 public TagInfoViewer(HistoryBrowserModel model) {
48 super(model);
49 }
50}
Note: See TracBrowser for help on using the repository browser.