Changeset 15772 in josm


Ignore:
Timestamp:
2020-01-26T18:26:20+01:00 (23 months ago)
Author:
simon04
Message:

Simplify HistoryViewerPanel.buildTable

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

Legend:

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

    r14463 r15772  
    3030    }
    3131
    32     protected abstract JTable buildReferenceTable();
    33 
    34     protected abstract JTable buildCurrentTable();
     32    protected abstract JTable buildTable(PointInTimeType pointInTimeType);
    3533
    3634    private void build() {
     
    7371        gc.fill = GridBagConstraints.BOTH;
    7472        gc.anchor = GridBagConstraints.NORTHWEST;
    75         add(embedInScrollPane(buildReferenceTable()), gc);
     73        add(embedInScrollPane(buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME)), gc);
    7674
    7775        gc.gridx = 1;
     
    8381        gc.fill = GridBagConstraints.BOTH;
    8482        gc.anchor = GridBagConstraints.NORTHWEST;
    85         add(embedInScrollPane(buildCurrentTable()), gc);
     83        add(embedInScrollPane(buildTable(PointInTimeType.CURRENT_POINT_IN_TIME)), gc);
    8684    }
    8785}
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r14692 r15772  
    5252
    5353    @Override
    54     protected JTable buildReferenceTable() {
    55         return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME, "table.referencenodelisttable");
    56     }
    57 
    58     @Override
    59     protected JTable buildCurrentTable() {
    60         return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME, "table.currentnodelisttable");
    61     }
    62 
    63     private JTable buildTable(PointInTimeType pointInTimeType, String name) {
     54    protected JTable buildTable(PointInTimeType pointInTimeType) {
    6455        final DiffTableModel tableModel = model.getNodeListTableModel(pointInTimeType);
    6556        final NodeListTableColumnModel columnModel = new NodeListTableColumnModel();
    6657        final JTable table = new JTable(tableModel, columnModel);
    6758        tableModel.addTableModelListener(new ReversedChangeListener(table, columnModel));
    68         table.setName(name);
    6959        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    7060        selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java

    r14675 r15772  
    3636
    3737    @Override
    38     protected JTable buildReferenceTable() {
    39         return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME, "table.referencememberlisttable");
    40     }
    41 
    42     @Override
    43     protected JTable buildCurrentTable() {
    44         return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME, "table.currentmemberlisttable");
    45     }
    46 
    47     private JTable buildTable(PointInTimeType pointInTimeType, String name) {
     38    protected JTable buildTable(PointInTimeType pointInTimeType) {
    4839        JTable table = new JTable(
    4940                model.getRelationMemberTableModel(pointInTimeType),
    5041                new RelationMemberTableColumnModel());
    51         table.setName(name);
    5242        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    5343        selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
  • trunk/src/org/openstreetmap/josm/gui/history/TagInfoViewer.java

    r15769 r15772  
    5959
    6060    @Override
    61     protected JTable buildReferenceTable() {
    62         return buildTable(PointInTimeType.REFERENCE_POINT_IN_TIME);
    63     }
    64 
    65     @Override
    66     protected JTable buildCurrentTable() {
    67         return buildTable(PointInTimeType.CURRENT_POINT_IN_TIME);
    68     }
    69 
    70     private JTable buildTable(PointInTimeType pointInTime) {
     61    protected JTable buildTable(PointInTimeType pointInTime) {
    7162        TagTableModel tagTableModel = model.getTagTableModel(pointInTime);
    7263        JTable table = new JTable(tagTableModel, new TagTableColumnModel());
Note: See TracChangeset for help on using the changeset viewer.