01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * @author Anton Avtamonov
20: * @version $Revision$
21: */package javax.swing.event;
22:
23: import java.util.EventObject;
24:
25: import javax.swing.table.TableModel;
26:
27: public class TableModelEvent extends EventObject {
28: public static final int UPDATE = 0;
29: public static final int INSERT = 1;
30: public static final int DELETE = -1;
31: public static final int HEADER_ROW = -1;
32: public static final int ALL_COLUMNS = -1;
33:
34: protected int type;
35: protected int firstRow;
36: protected int lastRow;
37: protected int column;
38:
39: public TableModelEvent(final TableModel source) {
40: this (source, 0, Integer.MAX_VALUE, ALL_COLUMNS, UPDATE);
41: }
42:
43: public TableModelEvent(final TableModel source, final int row) {
44: this (source, row, row, ALL_COLUMNS, UPDATE);
45: }
46:
47: public TableModelEvent(final TableModel source, final int firstRow,
48: final int lastRow) {
49: this (source, firstRow, lastRow, ALL_COLUMNS, UPDATE);
50: }
51:
52: public TableModelEvent(final TableModel source, final int firstRow,
53: final int lastRow, final int column) {
54: this (source, firstRow, lastRow, column, UPDATE);
55: }
56:
57: public TableModelEvent(final TableModel source, final int firstRow,
58: final int lastRow, final int column, final int type) {
59: super (source);
60: this .firstRow = firstRow;
61: this .lastRow = lastRow;
62: this .column = column;
63: this .type = type;
64: }
65:
66: public int getFirstRow() {
67: return firstRow;
68: }
69:
70: public int getLastRow() {
71: return lastRow;
72: }
73:
74: public int getColumn() {
75: return column;
76: }
77:
78: public int getType() {
79: return type;
80: }
81: }
|