KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > event > TreeExpansionEvent


1 /*
2  * @(#)TreeExpansionEvent.java 1.20 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.event;
9
10 import java.util.EventObject JavaDoc;
11 import javax.swing.tree.TreePath JavaDoc;
12
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
25  * appropriate for short term storage or RMI between applications running
26  * the same version of Swing. As of 1.4, support for long term storage
27  * of all JavaBeans<sup><font size="-2">TM</font></sup>
28  * has been added to the <code>java.beans</code> package.
29  * Please see {@link java.beans.XMLEncoder}.
30  *
31  * @author Scott Violet
32  * @version 1.20 12/19/03
33  */

34 public class TreeExpansionEvent extends EventObject JavaDoc
35 {
36     /**
37       * Path to the value this event represents.
38       */

39     protected TreePath JavaDoc path;
40
41     /**
42      * Constructs a TreeExpansionEvent object.
43      *
44      * @param source the Object that originated the event
45      * (typically <code>this</code>)
46      * @param path a TreePath object identifying the newly expanded
47      * node
48      */

49     public TreeExpansionEvent(Object JavaDoc source, TreePath JavaDoc path) {
50     super(source);
51     this.path = path;
52     }
53
54     /**
55       * Returns the path to the value that has been expanded/collapsed.
56       */

57     public TreePath JavaDoc getPath() { return path; }
58 }
59
Popular Tags