01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.tests.reportdata;
15:
16: import org.jetbrains.annotations.NotNull;
17:
18: import javax.swing.table.AbstractTableModel;
19:
20: /**
21: * User: Martin
22: * Date: 12.01.2006
23: * Time: 09:41:17
24: */
25: @SuppressWarnings({"ALL"})
26: public class ReportTableModel002 extends AbstractTableModel {
27: @NotNull
28: private String[] fields = new String[] { "FIRSTNAME", "LASTNAME",
29: "INCOME" };
30: @NotNull
31: private Class[] fieldTypes = new Class[] { String.class,
32: String.class, Double.class };
33:
34: @NotNull
35: private Object[][] values = new Object[][] {
36: { "Hugo", "Habicht", new Double(120) },
37: { "Hugo", "Bimpf", new Double(120) },
38: { "Hugo", "Test", new Double(130) },
39: { "Hans", "Meier", new Double(230) },
40: { "Hans", "Meiser", new Double(250) },
41: { "Hans", "Fritz", new Double(250) },
42: { "Reto", "Stirnemann", new Double(150) },
43: { "Reto", "Chlous", new Double(150) },
44: { "Reto", "Schmutzli", new Double(150) },
45: { "Reto", "Reeve", new Double(150) },
46: { "Reto", "Reeve", new Double(150) },
47: { "Reto", "Reeve", new Double(150) }, };
48:
49: public ReportTableModel002() {
50: }
51:
52: public int getRowCount() {
53: return values.length;
54: }
55:
56: public int getColumnCount() {
57: return fields.length;
58: }
59:
60: public String getColumnName(int columnIndex) {
61: return fields[columnIndex];
62: }
63:
64: public Class<?> getColumnClass(int columnIndex) {
65: return fieldTypes[columnIndex];
66: }
67:
68: public Object getValueAt(int rowIndex, int columnIndex) {
69: return values[rowIndex][columnIndex];
70: }
71: }
|