1. /*
  2. * @(#)TreeExpansionEvent.java 1.16 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.tree.TreePath;
  13. /**
  14. * An event used to identify a single path in a tree. The source
  15. * returned by <b>getSource</b> will be an instance of JTree.
  16. * <p>
  17. * For further documentation and examples see
  18. * the following sections in <em>The Java Tutorial</em>:
  19. * <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/treeexpansionlistener.html">How to Write a Tree Expansion Listener</a> and
  20. * <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener</a>.
  21. * <p>
  22. * <strong>Warning:</strong>
  23. * Serialized objects of this class will not be compatible with
  24. * future Swing releases. The current serialization support is appropriate
  25. * for short term storage or RMI between applications running the same
  26. * version of Swing. A future release of Swing will provide support for
  27. * long term persistence.
  28. *
  29. * @author Scott Violet
  30. * @version 1.16 02/02/00
  31. */
  32. public class TreeExpansionEvent extends EventObject
  33. {
  34. /**
  35. * Path to the value this event represents.
  36. */
  37. protected TreePath path;
  38. /**
  39. * Constructs a TreeExpansionEvent object.
  40. *
  41. * @param source the Object that originated the event
  42. * (typically <code>this</code>)
  43. * @param path a TreePath object identifying the newly expanded
  44. * node
  45. */
  46. public TreeExpansionEvent(Object source, TreePath path) {
  47. super(source);
  48. this.path = path;
  49. }
  50. /**
  51. * Returns the path to the value that has been expanded/collapsed.
  52. */
  53. public TreePath getPath() { return path; }
  54. }