Changeset 15774 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-01-26T18:26:24+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListViewer.java
r15772 r15774 6 6 import javax.swing.JTable; 7 7 import javax.swing.ListSelectionModel; 8 import javax.swing.event.TableModelEvent;9 import javax.swing.event.TableModelListener;10 8 11 9 /** … … 21 19 public class RelationMemberListViewer extends HistoryViewerPanel { 22 20 23 protected static class MemberModelChanged implements TableModelListener {24 private final JTable table;25 26 protected MemberModelChanged(JTable table) {27 this.table = table;28 }29 30 @Override31 public void tableChanged(TableModelEvent e) {32 Rectangle rect = table.getCellRect(((DiffTableModel) e.getSource()).getFirstChange(), 0, true);33 table.scrollRectToVisible(rect);34 }35 }36 37 21 @Override 38 22 protected JTable buildTable(PointInTimeType pointInTimeType) { … … 42 26 table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 43 27 selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel()); 44 table.getModel().addTableModelListener(new MemberModelChanged(table)); 28 table.getModel().addTableModelListener(e -> { 29 Rectangle rect = table.getCellRect(((DiffTableModel) e.getSource()).getFirstChange(), 0, true); 30 table.scrollRectToVisible(rect); 31 }); 45 32 return table; 46 33 }
Note:
See TracChangeset
for help on using the changeset viewer.