Source Code Cross Referenced for TreeNode.java in  » J2EE » Sofia » com » salmonllc » html » treeControl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Sofia » com.salmonllc.html.treeControl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2002, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        // 
009:        // This program is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:        // GNU General Public License for more details.
013:        // 
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        // 
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:        package com.salmonllc.html.treeControl;
021:
022:        /////////////////////////
023:        //$Archive: /SOFIA/SourceCode/com/salmonllc/html/treeControl/TreeNode.java $
024:        //$Author: Dan $ 
025:        //$Revision: 10 $ 
026:        //$Modtime: 8/28/03 10:58a $ 
027:        /////////////////////////
028:
029:        import java.util.*;
030:
031:        class TreeNode implements  java.io.Serializable {
032:            Integer _image;
033:            Integer _expImage;
034:            Integer _index;
035:            Integer _level;
036:            String _text;
037:            String _URL;
038:            String _imageURL;
039:            boolean _expanded = false;
040:            TreeNode _parent, _firstChild, _lastChild, _nextNode, _priorNode;
041:            boolean _hasChildren = false;
042:            Vector _additionalImages;
043:            Vector _additionalText;
044:            Vector _additionalURL;
045:            Object _keyValue;
046:            boolean _selected = false;
047:            boolean _selectable = true;
048:            int _dsRowNo = -1;
049:
050:            TreeNode(int image, int expImage, String text, String url,
051:                    String imageURL, Object key) {
052:                super ();
053:                _image = new Integer(image);
054:                _expImage = new Integer(expImage);
055:                _text = text;
056:                _URL = url;
057:                _expanded = false;
058:                _imageURL = imageURL;
059:                _keyValue = key;
060:            }
061:
062:            void setImages(int image, int expImage) {
063:                _image = new Integer(image);
064:                _expImage = new Integer(expImage);
065:            }
066:
067:            int addAdditionalImage(int imageNo, String text, String url) {
068:                if (_additionalImages == null) {
069:                    _additionalImages = new Vector();
070:                    _additionalText = new Vector();
071:                    _additionalURL = new Vector();
072:                }
073:
074:                _additionalImages.addElement(new Integer(imageNo));
075:                _additionalText.addElement(text);
076:                _additionalURL.addElement(url);
077:
078:                return (_additionalImages.size() - 1);
079:            }
080:
081:            boolean areThereChildren() {
082:                return _hasChildren;
083:            }
084:
085:            void clearAdditionalImages() {
086:                _additionalImages = null;
087:                _additionalText = null;
088:            }
089:
090:            int getAdditionalImage(int index) {
091:                return ((Integer) _additionalImages.elementAt(index))
092:                        .intValue();
093:            }
094:
095:            int getAdditionalImageCount() {
096:                if (_additionalImages == null)
097:                    return 0;
098:
099:                return _additionalImages.size();
100:            }
101:
102:            String getAdditionalText(int index) {
103:                return (String) _additionalText.elementAt(index);
104:            }
105:
106:            String getAdditionalURL(int index) {
107:                return (String) _additionalURL.elementAt(index);
108:            }
109:
110:            TreeNode getFirstChild() {
111:                return _firstChild;
112:            }
113:
114:            int getHandle() {
115:                return _index.intValue();
116:            }
117:
118:            int getImage() {
119:                if (_expanded)
120:                    return _expImage.intValue();
121:                else
122:                    return _image.intValue();
123:            }
124:
125:            String getImageURL() {
126:                return _imageURL;
127:            }
128:
129:            Object getKey() {
130:                return _keyValue;
131:            }
132:
133:            TreeNode getLastChild() {
134:                return _lastChild;
135:            }
136:
137:            int getLevel() {
138:                return _level.intValue();
139:            }
140:
141:            TreeNode getNextNode() {
142:                return _nextNode;
143:            }
144:
145:            TreeNode getParent() {
146:                return _parent;
147:            }
148:
149:            TreeNode getPriorNode() {
150:                return _priorNode;
151:            }
152:
153:            boolean getSelectable() {
154:                return _selectable;
155:            }
156:
157:            boolean getSelected() {
158:                return _selected;
159:            }
160:
161:            String getText() {
162:                return _text;
163:            }
164:
165:            String getURL() {
166:                return _URL;
167:            }
168:
169:            boolean isExpanded() {
170:                return _expanded;
171:            }
172:
173:            void reset() {
174:                _parent = null;
175:                _firstChild = null;
176:                _lastChild = null;
177:                _nextNode = null;
178:                _priorNode = null;
179:            }
180:
181:            void setExpanded(boolean expanded) {
182:                _expanded = expanded;
183:            }
184:
185:            void setFirstChild(TreeNode firstChild) {
186:                _firstChild = firstChild;
187:            }
188:
189:            void setHandle(int handle) {
190:                _index = new Integer(handle);
191:            }
192:
193:            void setHasChildren(boolean h) {
194:                _hasChildren = h;
195:            }
196:
197:            void setKey(Object key) {
198:                _keyValue = key;
199:            }
200:
201:            void setLastChild(TreeNode lastChild) {
202:                _lastChild = lastChild;
203:            }
204:
205:            void setLevel(int level) {
206:                _level = new Integer(level);
207:            }
208:
209:            void setNextNode(TreeNode nextNode) {
210:                _nextNode = nextNode;
211:            }
212:
213:            void setParent(TreeNode parent) {
214:                _parent = parent;
215:            }
216:
217:            void setPriorNode(TreeNode t) {
218:                _priorNode = t;
219:            }
220:
221:            void setSelectable(boolean trueFalse) {
222:                _selectable = trueFalse;
223:            }
224:
225:            void setSelected(boolean selected) {
226:                _selected = selected;
227:            }
228:
229:            void setText(String text) {
230:                _text = text;
231:            }
232:
233:            void setURL(String url) {
234:                _URL = url;
235:            }
236:
237:            public int getDsRowNo() {
238:                return _dsRowNo;
239:            }
240:
241:            public void setDsRowNo(int i) {
242:                _dsRowNo = i;
243:            }
244:
245:            public String getFullPath() {
246:                StringBuffer ret = new StringBuffer();
247:                TreeNode n = this ;
248:                if (_firstChild == null)
249:                    n = _parent;
250:
251:                while (n != null) {
252:                    ret.insert(0, n.getText());
253:                    ret.insert(0, "|");
254:                    n = n.getParent();
255:                }
256:                ret.insert(0, new Integer(getLevel()).toString());
257:                return ret.toString();
258:            }
259:
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.