Last change
on this file since 4932 was 4689, checked in by stoecker, 12 years ago |
don't have multiple classes in one file
|
File size:
997 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.history;
|
---|
3 |
|
---|
4 | import java.util.ArrayList;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | import javax.swing.table.AbstractTableModel;
|
---|
8 |
|
---|
9 | /**
|
---|
10 | * Simple model storing "diff cells" in a list. Could probably have used a DefaultTableModel instead..
|
---|
11 | *
|
---|
12 | * {@see NodeListDiffTableCellRenderer}
|
---|
13 | */
|
---|
14 | class DiffTableModel extends AbstractTableModel {
|
---|
15 | private List<TwoColumnDiff.Item> rows;
|
---|
16 |
|
---|
17 | public void setRows(List<TwoColumnDiff.Item> rows) {
|
---|
18 | this.rows = rows;
|
---|
19 | }
|
---|
20 |
|
---|
21 | public DiffTableModel(List<TwoColumnDiff.Item> rows) {
|
---|
22 | this.rows = rows;
|
---|
23 | }
|
---|
24 | public DiffTableModel() {
|
---|
25 | this.rows = new ArrayList<TwoColumnDiff.Item>();
|
---|
26 | }
|
---|
27 | @Override
|
---|
28 | public int getRowCount() {
|
---|
29 | return rows.size();
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public int getColumnCount() {
|
---|
34 | return 1;
|
---|
35 | }
|
---|
36 |
|
---|
37 | @Override
|
---|
38 | public TwoColumnDiff.Item getValueAt(int rowIndex, int columnIndex) {
|
---|
39 | return rows.get(rowIndex);
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.