source: josm/trunk/src/org/openstreetmap/josm/gui/history/DiffTableModel.java@ 5319

Last change on this file since 5319 was 5266, checked in by bastiK, 12 years ago

fixed majority of javadoc warnings by replacing "{@see" by "{@link"

File size: 998 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.history;
3
4import java.util.ArrayList;
5import java.util.List;
6
7import javax.swing.table.AbstractTableModel;
8
9/**
10 * Simple model storing "diff cells" in a list. Could probably have used a DefaultTableModel instead..
11 *
12 * {@link NodeListDiffTableCellRenderer}
13 */
14class 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.