KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > frovi > ss > Tree > BaseNode


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package com.frovi.ss.Tree;
25
26 import java.util.HashMap JavaDoc;
27 import java.util.List JavaDoc;
28 import java.util.Map JavaDoc;
29 import java.util.Vector JavaDoc;
30
31 /**
32  * BaseNode.java
33  * PureHtmlTree node object
34  * Created on 2002-sep-27
35  * @author Stefan Sik, ss@frovi.com
36  * ss
37  */

38 public abstract class BaseNode extends Object JavaDoc
39 {
40     
41     private String JavaDoc title;
42     private Integer JavaDoc id;
43
44     // Gaphical stuff
45
private boolean container;
46     private boolean children;
47     private Vector JavaDoc treeStuff;
48     private boolean open = false;
49     private String JavaDoc openCloseKey = "";
50     private String JavaDoc openCloseKeyEx = "";
51     private String JavaDoc thisKey = "";
52     private int level = 0;
53     private boolean root = false;
54     private Map JavaDoc parameters = new HashMap JavaDoc();
55
56     
57     /**
58      * Returns the id.
59      * @return Integer
60      */

61     public Integer JavaDoc getId()
62     {
63         return id;
64     }
65
66     /**
67      * Returns the title.
68      * @return String
69      */

70     public String JavaDoc getTitle()
71     {
72         return title;
73     }
74
75     /**
76      * Sets the id.
77      * @param id The id to set
78      */

79     public void setId(Integer JavaDoc id)
80     {
81         this.id = id;
82     }
83
84     /**
85      * Sets the title.
86      * @param title The title to set
87      */

88     public void setTitle(String JavaDoc title)
89     {
90         this.title = title;
91     }
92
93     /**
94      * Returns the treeStuff.
95      * @return ArrayList
96      */

97     public Vector JavaDoc getTreeStuff() {
98         return treeStuff;
99     }
100     
101     // TODO: Clean up this
102
public List JavaDoc getRowList() {
103         return treeStuff;
104     }
105
106     /**
107      * Sets the treeStuff.
108      * @param treeStuff The treeStuff to set
109      */

110     public void setTreeStuff(Vector JavaDoc treeStuff) {
111         this.treeStuff = treeStuff;
112     }
113
114
115     /**
116      * Returns the open.
117      * @return boolean
118      */

119     public boolean isOpen() {
120         return open;
121     }
122
123     /**
124      * Sets the open.
125      * @param open The open to set
126      */

127     public void setOpen(boolean open) {
128         this.open = open;
129     }
130
131     /**
132      * Returns the level.
133      * @return int
134      */

135     public int getLevel() {
136         return level;
137     }
138
139     /**
140      * Sets the level.
141      * @param level The level to set
142      */

143     public void setLevel(int level) {
144         this.level = level;
145     }
146
147     /**
148      * Returns the openCloseKey.
149      * @return String
150      */

151     public String JavaDoc getOpenCloseKey() {
152         return openCloseKey;
153     }
154
155     /**
156      * Sets the openCloseKey.
157      * @param openCloseKey The openCloseKey to set
158      */

159     public void setOpenCloseKey(String JavaDoc openCloseKey) {
160         this.openCloseKey = openCloseKey;
161     }
162
163
164     /**
165      * Returns the children.
166      * @return boolean
167      */

168     public boolean hasChildren() {
169         return children;
170     }
171
172     /**
173      * Sets the children.
174      * @param children The children to set
175      */

176     public void setChildren(boolean children) {
177         this.children = children;
178     }
179
180     /**
181      * Returns the container.
182      * @return boolean
183      */

184     public boolean isContainer() {
185         return container;
186     }
187
188     /**
189      * Sets the container.
190      * @param container The container to set
191      */

192     public void setContainer(boolean container) {
193         this.container = container;
194     }
195
196     /**
197      * Returns the thisKey.
198      * @return String
199      */

200     public String JavaDoc getThisKey()
201     {
202         return thisKey;
203     }
204
205     /**
206      * Sets the thisKey.
207      * @param thisKey The thisKey to set
208      */

209     public void setThisKey(String JavaDoc thisKey)
210     {
211         this.thisKey = thisKey;
212     }
213
214     /**
215      * Returns the root.
216      * @return boolean
217      */

218     public boolean isRoot()
219     {
220         return root;
221     }
222
223     /**
224      * Sets the root.
225      * @param root The root to set
226      */

227     public void setIsRoot(boolean root)
228     {
229         this.root = root;
230     }
231
232     /**
233      * Returns the openCloseKeyEx.
234      * @return String
235      */

236     public String JavaDoc getOpenCloseKeyEx()
237     {
238         return openCloseKeyEx;
239     }
240
241     /**
242      * Sets the openCloseKeyEx.
243      * @param openCloseKeyEx The openCloseKeyEx to set
244      */

245     public void setOpenCloseKeyEx(String JavaDoc openCloseKeyEx)
246     {
247         this.openCloseKeyEx = openCloseKeyEx;
248     }
249
250     public Map JavaDoc getParameters()
251     {
252         return parameters;
253     }
254 }
255
Popular Tags