KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nemesis > forum > util > tree > TreeNode


1 /*
2  * NEMESIS-FORUM.
3  * Copyright (C) 2002 David Laurent(lithium2@free.fr). All rights reserved.
4  *
5  * Copyright (c) 2000 The Apache Software Foundation. All rights reserved.
6  *
7  * Copyright (C) 2001 Yasna.com. All rights reserved.
8  *
9  * Copyright (C) 2000 CoolServlets.com. All rights reserved.
10  *
11  * NEMESIS-FORUM. is free software; you can redistribute it and/or
12  * modify it under the terms of the Apache Software License, Version 1.1,
13  * or (at your option) any later version.
14  *
15  * NEMESIS-FORUM core framework, NEMESIS-FORUM backoffice, NEMESIS-FORUM frontoffice
16  * application are parts of NEMESIS-FORUM and are distributed under
17  * same terms of licence.
18  *
19  *
20  * NEMESIS-FORUM includes software developed by the Apache Software Foundation (http://www.apache.org/)
21  * and software developed by CoolServlets.com (http://www.coolservlets.com).
22  * and software developed by Yasna.com (http://www.yasna.com).
23  *
24  */

25
26
27 package org.nemesis.forum.util.tree;
28
29 import java.io.Serializable JavaDoc;
30
31 public class TreeNode extends TreeObject implements TreeInterface, Serializable JavaDoc {
32
33     private String JavaDoc name;
34     private String JavaDoc link;
35     private boolean visible;
36     private Tree children;
37     private int id;
38
39     public TreeNode( int id, String JavaDoc name ) {
40         super(0);
41         this.id = id;
42         this.name = name;
43         visible = true;
44         children = new Tree();
45     }
46     public TreeNode( int id, String JavaDoc name, String JavaDoc link ) {
47         super(0);
48         this.id = id;
49         this.name = name;
50         this.link = link;
51         visible = true;
52         children = new Tree();
53     }
54     public void addChild(TreeObject child) {
55         children.addChild(child);
56     }
57     public int getId() {
58         return id;
59     }
60     public String JavaDoc getName() {
61         return name;
62     }
63     public String JavaDoc getLink() {
64         return link;
65     }
66     public Tree getChildren() {
67         return children;
68     }
69     public boolean isVisible() {
70         return visible;
71     }
72     public void setId( int id ) {
73         this.id = id;
74     }
75     public void setName(String JavaDoc name) {
76         this.name = name;
77     }
78     public void setLink( String JavaDoc link ) {
79         this.link = link;
80     }
81     public void setVisible(boolean value) {
82         visible = value;
83     }
84     public void toggleVisible() {
85         visible = !visible;
86     }
87 }
88
Popular Tags