KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > tree > TreeModelChangeEvent


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.wcf.tree;
14
15 import java.util.EventObject JavaDoc;
16
17 /**
18  * informs listeners about changes in the tree model.
19  * If identityChanged == true, then the identity of the nodes
20  * have changed, which means - for example - that the selection
21  * will be cleared.
22  *
23  * @author av
24  */

25 public class TreeModelChangeEvent extends EventObject JavaDoc {
26   boolean identityChanged;
27   Object JavaDoc subtree;
28
29   public TreeModelChangeEvent(TreeModel source, boolean identityChanged) {
30     super(source);
31     this.identityChanged = identityChanged;
32   }
33
34   public TreeModelChangeEvent(TreeModel source, Object JavaDoc subtree, boolean identityChanged) {
35     super(source);
36     this.identityChanged = identityChanged;
37     this.subtree = subtree;
38   }
39
40   public TreeModel getTreeModel() {
41     return (TreeModel) getSource();
42   }
43
44   public boolean isIdentityChanged() {
45     return identityChanged;
46   }
47
48   /**
49    * changes are restricted to the returned node and its descendants. If null,
50    * changes affect the whole tree.
51    */

52   public Object JavaDoc getSubtree() {
53     return subtree;
54   }
55 }
56
Popular Tags