Changeset 17921 in josm


Ignore:
Timestamp:
2021-06-02T23:14:11+02:00 (6 months ago)
Author:
simon04
Message:

fix #18697 - Revert "Simplify HistoryViewerPanel.buildTable"

This reverts commit r15772

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryViewerPanel.java

    r16609 r17921  
    4343    }
    4444
    45     protected abstract JTable buildTable(PointInTimeType pointInTimeType);
     45    protected abstract JTable buildReferenceTable();
     46
     47    protected abstract JTable buildCurrentTable();
    4648
    4749    private void build() {
     
    8486        gc.fill = GridBagConstraints.BOTH;
    8587        gc.anchor = GridBagConstraints.NORTHWEST;
    86         add(embedInScrollPane(buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME)), gc);
     88        add(embedInScrollPane(buildReferenceTable()), gc);
    8789
    8890        gc.gridx = 1;
     
    9496        gc.fill = GridBagConstraints.BOTH;
    9597        gc.anchor = GridBagConstraints.NORTHWEST;
    96         add(embedInScrollPane(buildTable(PointInTimeType.CURRENT_POINT_IN_TIME)), gc);
     98        add(embedInScrollPane(buildCurrentTable()), gc);
    9799    }
    98100
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r16960 r17921  
    3838
    3939    @Override
    40     protected JTable buildTable(PointInTimeType pointInTimeType) {
     40    protected JTable buildReferenceTable() {
     41        return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME, "table.referencenodelisttable");
     42    }
     43
     44    @Override
     45    protected JTable buildCurrentTable() {
     46        return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME, "table.currentnodelisttable");
     47    }
     48
     49    private JTable buildTable(PointInTimeType pointInTimeType, String name) {
    4150        final DiffTableModel tableModel = model.getNodeListTableModel(pointInTimeType);
    4251        final NodeListTableColumnModel columnModel = new NodeListTableColumnModel();
     
    4453        TableHelper.setFont(table, getClass());
    4554        tableModel.addTableModelListener(new ReversedChangeListener(table, columnModel, tr("The nodes of this way are in reverse order")));
     55        table.setName(name);
    4656        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    4757        selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java

    r16960 r17921  
    2929
    3030    @Override
    31     protected JTable buildTable(PointInTimeType pointInTimeType) {
     31    protected JTable buildReferenceTable() {
     32        return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME, "table.referencememberlisttable");
     33    }
     34
     35    @Override
     36    protected JTable buildCurrentTable() {
     37        return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME, "table.currentmemberlisttable");
     38    }
     39
     40    private JTable buildTable(PointInTimeType pointInTimeType, String name) {
    3241        final DiffTableModel tableModel = model.getRelationMemberTableModel(pointInTimeType);
    3342        final RelationMemberTableColumnModel columnModel = new RelationMemberTableColumnModel();
     
    3645        tableModel.addTableModelListener(new ReversedChangeListener(
    3746                table, columnModel, tr("The members of this relation are in reverse order")));
     47        table.setName(name);
    3848        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    3949        selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
  • trunk/src/org/openstreetmap/josm/gui/history/TagInfoViewer.java

    r17684 r17921  
    6262
    6363    @Override
    64     protected JTable buildTable(PointInTimeType pointInTime) {
     64    protected JTable buildReferenceTable() {
     65        return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME);
     66    }
     67
     68    @Override
     69    protected JTable buildCurrentTable() {
     70        return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME);
     71    }
     72
     73    private JTable buildTable(PointInTimeType pointInTime) {
    6574        TagTableModel tagTableModel = model.getTagTableModel(pointInTime);
    6675        JTable table = new JTable(tagTableModel, new TagTableColumnModel());
Note: See TracChangeset for help on using the changeset viewer.