KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > event > TableColumnModelEvent


1 /*
2  * @(#)TableColumnModelEvent.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.event;
9
10 import java.util.EventObject JavaDoc;
11 import javax.swing.table.*;
12
13 /**
14  * <B>TableColumnModelEvent</B> is used to notify listeners that a table
15  * column model has changed, such as a column was added, removed, or
16  * moved.
17  * <p>
18  * <strong>Warning:</strong>
19  * Serialized objects of this class will not be compatible with
20  * future Swing releases. The current serialization support is
21  * appropriate for short term storage or RMI between applications running
22  * the same version of Swing. As of 1.4, support for long term storage
23  * of all JavaBeans<sup><font size="-2">TM</font></sup>
24  * has been added to the <code>java.beans</code> package.
25  * Please see {@link java.beans.XMLEncoder}.
26  *
27  * @version 1.16 12/19/03
28  * @author Alan Chung
29  * @see TableColumnModelListener
30  */

31 public class TableColumnModelEvent extends java.util.EventObject JavaDoc
32 {
33 //
34
// Instance Variables
35
//
36

37     /** The index of the column from where it was moved or removed */
38     protected int fromIndex;
39
40     /** The index of the column to where it was moved or added from */
41     protected int toIndex;
42
43 //
44
// Constructors
45
//
46

47     /**
48      * Constructs a TableColumnModelEvent object.
49      *
50      * @param source the TableColumnModel that originated the event
51      * (typically <code>this</code>)
52      * @param from an int specifying the first row in a range of affected rows
53      * @param to an int specifying the last row in a range of affected rows
54      */

55     public TableColumnModelEvent(TableColumnModel source, int from, int to) {
56     super(source);
57     fromIndex = from;
58     toIndex = to;
59     }
60     
61 //
62
// Querying Methods
63
//
64

65     /** Returns the fromIndex. Valid for removed or moved events */
66     public int getFromIndex() { return fromIndex; };
67
68     /** Returns the toIndex. Valid for add and moved events */
69     public int getToIndex() { return toIndex; };
70 }
71
Popular Tags