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

Last change on this file since 6883 was 6207, checked in by Don-vip, 11 years ago

Sonar - refactor duplicate code in history browsing panels

  • 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 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}
Note: See TracBrowser for help on using the repository browser.