KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
16  * @author av
17  */

18 public class TreeModelDecorator implements TreeModel, DecoratedTreeModel {
19   private TreeModel decoree;
20
21   public TreeModelDecorator() {
22   }
23
24   public TreeModelDecorator(TreeModel decoree) {
25     this.decoree = decoree;
26   }
27
28   public Object JavaDoc[] getRoots() {
29     return decoree.getRoots();
30   }
31
32   public boolean hasChildren(Object JavaDoc node) {
33     return decoree.hasChildren(node);
34   }
35
36   public Object JavaDoc[] getChildren(Object JavaDoc node) {
37     return decoree.getChildren(node);
38   }
39
40   public Object JavaDoc getParent(Object JavaDoc node) {
41     return decoree.getParent(node);
42   }
43
44   public void addTreeModelChangeListener(TreeModelChangeListener l) {
45     decoree.addTreeModelChangeListener(l);
46   }
47
48   public void removeTreeModelChangeListener(TreeModelChangeListener l) {
49     decoree.removeTreeModelChangeListener(l);
50   }
51
52   public void fireModelChanged(boolean identityChanged) {
53     decoree.fireModelChanged(identityChanged);
54   }
55
56   public TreeModel getDecoree() {
57     return decoree;
58   }
59
60   public void setDecoree(TreeModel model) {
61     decoree = model;
62   }
63
64 }
65
Popular Tags