1. /*
  2. * @(#)TableColumnModelEvent.java 1.12 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.event;
  11. import java.util.EventObject;
  12. import javax.swing.table.*;
  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 appropriate
  21. * for short term storage or RMI between applications running the same
  22. * version of Swing. A future release of Swing will provide support for
  23. * long term persistence.
  24. *
  25. * @version 1.12 02/02/00
  26. * @author Alan Chung
  27. * @see TableColumnModelListener
  28. */
  29. public class TableColumnModelEvent extends java.util.EventObject
  30. {
  31. //
  32. // Instance Variables
  33. //
  34. /** The index of the column from where it was moved or removed */
  35. protected int fromIndex;
  36. /** The index of the column to where it was moved or added from */
  37. protected int toIndex;
  38. //
  39. // Constructors
  40. //
  41. /**
  42. * Constructs a TableColumnModelEvent object.
  43. *
  44. * @param source the TableColumnModel that originated the event
  45. * (typically <code>this</code>)
  46. * @param from an int specifying the first row in a range of affected rows
  47. * @param to an int specifying the last row in a range of affected rows
  48. */
  49. public TableColumnModelEvent(TableColumnModel source, int from, int to) {
  50. super(source);
  51. fromIndex = from;
  52. toIndex = to;
  53. }
  54. //
  55. // Querying Methods
  56. //
  57. /** Returns the fromIndex. Valid for removed or moved events */
  58. public int getFromIndex() { return fromIndex; };
  59. /** Returns the toIndex. Valid for add and moved events */
  60. public int getToIndex() { return toIndex; };
  61. }