01: package vicazh.hyperpool.stream;
02:
03: import java.util.*;
04:
05: /**
06: * The time selector table model
07: *
08: * @author Victor Zhigunov
09: * @version 0.3.9
10: */
11: public class ITimeModel extends ISelectorModel {
12: private String[] names;
13:
14: /**
15: * @param name
16: * column name for time value
17: * @param index
18: * column name for index
19: * @param names
20: * names array
21: */
22: public ITimeModel(Object name, Object index, final String[] names) {
23: super (name, index, new ArrayList<Object>() {
24: public Object get(int index) {
25: return new Integer(index);
26: }
27:
28: public int size() {
29: return names.length;
30: }
31: });
32: this .names = names;
33: }
34:
35: public boolean isCellEditable(int row, int column) {
36: return column == 1;
37: }
38:
39: public Object getValueAt(int row, int column) {
40: switch (column) {
41: case 0:
42: return names[row];
43: case 1:
44: return super.getValueAt(row, column);
45: }
46: return null;
47: }
48: }
|