1 15 16 package swingwtx.swing.event; 17 18 import swingwtx.swing.table.TableModel; 19 20 21 public class TableModelEvent extends java.util.EventObject 22 { 23 public static final int INSERT = 1; 24 public static final int UPDATE = 0; 25 public static final int DELETE = -1; 26 public static final int HEADER_ROW = -1; 27 public static final int ALL_COLUMNS = -1; 28 29 protected int type; 30 protected int firstRow; 31 protected int lastRow; 32 protected int column; 33 34 public TableModelEvent(TableModel source) { 35 this(source, 0, Integer.MAX_VALUE, ALL_COLUMNS, UPDATE); 36 } 37 public TableModelEvent(TableModel source, int row) { 38 this(source, row, row, ALL_COLUMNS, UPDATE); 39 } 40 public TableModelEvent(TableModel source, int firstRow, int lastRow) { 41 this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); 42 } 43 public TableModelEvent(TableModel source, int firstRow, int lastRow, int column) { 44 this(source, firstRow, lastRow, column, UPDATE); 45 } 46 public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type) { 47 super(source); 48 this.firstRow = firstRow; 49 this.lastRow = lastRow; 50 this.column = column; 51 this.type = type; 52 } 53 public int getFirstRow() { return firstRow; }; 54 public int getLastRow() { return lastRow; }; 55 public int getColumn() { return column; }; 56 public int getType() { return type; } 57 } 58 | Popular Tags |