1. /*
  2. * @(#)TreeExpansionEvent.java 1.14 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.tree.TreePath;
  10. /**
  11. * An event used to identify a single path in a tree. The source
  12. * returned by <b>getSource</b> will be an instance of JTree.
  13. * <p>
  14. * <strong>Warning:</strong>
  15. * Serialized objects of this class will not be compatible with
  16. * future Swing releases. The current serialization support is appropriate
  17. * for short term storage or RMI between applications running the same
  18. * version of Swing. A future release of Swing will provide support for
  19. * long term persistence.
  20. *
  21. * @author Scott Violet
  22. * @version 1.14 11/29/01
  23. */
  24. public class TreeExpansionEvent extends EventObject
  25. {
  26. /**
  27. * Path to the value this event represents.
  28. */
  29. protected TreePath path;
  30. /**
  31. * Constructs a TreeExpansionEvent object.
  32. *
  33. * @param source the Object that originated the event
  34. * (typically <code>this</code>)
  35. * @param path a TreePath object identifying the newly expanded
  36. * node
  37. */
  38. public TreeExpansionEvent(Object source, TreePath path) {
  39. super(source);
  40. this.path = path;
  41. }
  42. /**
  43. * Returns the path to the value that has been expanded/collapsed.
  44. */
  45. public TreePath getPath() { return path; }
  46. }