1. /*
  2. * @(#)TableColumnModelEvent.java 1.11 01/11/29
  3. *
  4. * Copyright 2002 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 appropriate
  18. * for short term storage or RMI between applications running the same
  19. * version of Swing. A future release of Swing will provide support for
  20. * long term persistence.
  21. *
  22. * @version 1.11 11/29/01
  23. * @author Alan Chung
  24. * @see TableColumnModelListener
  25. */
  26. public class TableColumnModelEvent extends java.util.EventObject
  27. {
  28. //
  29. // Instance Variables
  30. //
  31. /** The index of the column from where it was moved or removed */
  32. protected int fromIndex;
  33. /** The index of the column to where it was moved or added from */
  34. protected int toIndex;
  35. //
  36. // Constructors
  37. //
  38. /**
  39. * Constructs a TableColumnModelEvent object.
  40. *
  41. * @param source the TableColumnModel that originated the event
  42. * (typically <code>this</code>)
  43. * @param from an int specifying the first row in a range of affected rows
  44. * @param to an int specifying the last row in a range of affected rows
  45. */
  46. public TableColumnModelEvent(TableColumnModel source, int from, int to) {
  47. super(source);
  48. fromIndex = from;
  49. toIndex = to;
  50. }
  51. //
  52. // Querying Methods
  53. //
  54. /** Returns the fromIndex. Valid for removed or moved events */
  55. public int getFromIndex() { return fromIndex; };
  56. /** Returns the toIndex. Valid for add and moved events */
  57. public int getToIndex() { return toIndex; };
  58. }