1. /*
  2. * @(#)TableColumnModelEvent.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.event;
  8. import java.util.EventObject;
  9. import javax.swing.table.*;
  10. /**
  11. * <B>TableColumnModelEvent</B> is used to notify listeners that a table
  12. * column model has changed, such as a column was added, removed, or
  13. * moved.
  14. * <p>
  15. * <strong>Warning:</strong>
  16. * Serialized objects of this class will not be compatible with
  17. * future Swing releases. The current serialization support is
  18. * appropriate for short term storage or RMI between applications running
  19. * the same version of Swing. As of 1.4, support for long term storage
  20. * of all JavaBeans<sup><font size="-2">TM</font></sup>
  21. * has been added to the <code>java.beans</code> package.
  22. * Please see {@link java.beans.XMLEncoder}.
  23. *
  24. * @version 1.15 01/23/03
  25. * @author Alan Chung
  26. * @see TableColumnModelListener
  27. */
  28. public class TableColumnModelEvent extends java.util.EventObject
  29. {
  30. //
  31. // Instance Variables
  32. //
  33. /** The index of the column from where it was moved or removed */
  34. protected int fromIndex;
  35. /** The index of the column to where it was moved or added from */
  36. protected int toIndex;
  37. //
  38. // Constructors
  39. //
  40. /**
  41. * Constructs a TableColumnModelEvent object.
  42. *
  43. * @param source the TableColumnModel that originated the event
  44. * (typically <code>this</code>)
  45. * @param from an int specifying the first row in a range of affected rows
  46. * @param to an int specifying the last row in a range of affected rows
  47. */
  48. public TableColumnModelEvent(TableColumnModel source, int from, int to) {
  49. super(source);
  50. fromIndex = from;
  51. toIndex = to;
  52. }
  53. //
  54. // Querying Methods
  55. //
  56. /** Returns the fromIndex. Valid for removed or moved events */
  57. public int getFromIndex() { return fromIndex; };
  58. /** Returns the toIndex. Valid for add and moved events */
  59. public int getToIndex() { return toIndex; };
  60. }