Source Code Cross Referenced for TreeNodeX.java in  » Portal » Open-Portal » ob » tree » 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 » Portal » Open Portal » ob.tree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Stingray Software Objective Blend
003:         * Copyright (C) 1996 Stingray Software, Inc.
004:         * All Rights Reserved
005:         *
006:         * This source code is only intended as a supplement to
007:         * the Stingray Objective Blend product.  See the Objective
008:         * Blend html help documentation for detailed information regarding
009:         * using OB classes.
010:         *
011:         * Author : Kerry Smith
012:         * Description : TreeNodeX.java - tree control node data structure
013:         *
014:         * CHANGELOG:
015:         * 7/09/96 	LFW	Created
016:         * 3/12/97  JDK1.1
017:         *
018:         */
019:
020:        package ob.tree;
021:
022:        import java.io.Serializable;
023:        import com.sun.portal.log.common.PortalLogger;
024:
025:        /**
026:         * This class describes an individual node in the tree which can contain
027:         * other children nodes.  The ob.tree.Node class further extends the TreeNodeX
028:         * class to provide further methods to customize the nodes.  Many of these methods
029:         * are used internally and will not need to be manipulated by the developer.
030:         * @see ob.tree.TreeBase
031:         * @see ob.tree.Node
032:         * @see ob.listbox.ListBox
033:         */
034:
035:        public class TreeNodeX extends TreeNode {
036:
037:            int m_root_nFilterLevel = 0; // only valid in root node
038:
039:            /**
040:             * sets the filter level
041:             * @param nLevel which level to filter
042:             * @return whether filter was successful
043:             */
044:            public boolean setFilterLevel(int nLevel) {
045:                ((TreeNodeX) getRoot()).m_root_nFilterLevel = nLevel;
046:                return true;
047:            }
048:
049:            /**
050:             * retrieves the filter level
051:             * @return filter level as type int
052:             */
053:            public int getFilterLevel() {
054:                return ((TreeNodeX) getRoot()).m_root_nFilterLevel;
055:            }
056:
057:            /**
058:             * retrieves the unfiltered distance from the root
059:             * @return unfiltered distance as type int
060:             */
061:            public int getUnfilteredDistanceFromRoot() {
062:                int w;
063:                TreeNode pNode = m_pParent;
064:
065:                for (w = 0; pNode != null; w++)
066:                    pNode = pNode.m_pParent;
067:
068:                return w;
069:            }
070:
071:            /**
072:             * retrieves the parent node
073:             * @return parent node as type TreeNode
074:             */
075:            public TreeNode getParent() {
076:                if (getFilterLevel() > 0 && m_pParent != null) {
077:                    if (getUnfilteredDistanceFromRoot() == (getFilterLevel() + 1)) {
078:                        return m_pParent.m_pParent;
079:                    }
080:                }
081:                return m_pParent;
082:            }
083:
084:            /**
085:             * retrieves the next sibling node
086:             * @return next sibling node as type TreeNode
087:             */
088:            public TreeNode getNextSibling() {
089:                if (getFilterLevel() > 0) {
090:                    if (getUnfilteredDistanceFromRoot() == (getFilterLevel() + 1)) {
091:                        if (m_pNextSibling == null) {
092:                            TreeNode pNode = m_pParent;
093:                            if (pNode == null)
094:                                return null;
095:                            pNode = pNode.m_pNextSibling;
096:                            if (pNode == null)
097:                                return null;
098:
099:                            pNode = pNode.m_pFirstChild;
100:                            return pNode;
101:                        }
102:                    }
103:                }
104:                return m_pNextSibling;
105:
106:            }
107:
108:            /**
109:             * retrieves the previous sibling node
110:             * @return previous sibling as type TreeNode
111:             */
112:            public TreeNode getPrevSibling() {
113:                if (getFilterLevel() > 0) {
114:                    if (getUnfilteredDistanceFromRoot() == (getFilterLevel() + 1)) {
115:                        if (m_pPrevSibling == null) {
116:                            TreeNode pNode = m_pParent;
117:                            if (pNode == null)
118:                                return null;
119:                            pNode = pNode.m_pPrevSibling;
120:                            if (pNode == null)
121:                                return null;
122:
123:                            pNode = pNode.m_pFirstChild;
124:                            if (pNode == null)
125:                                return null;
126:                            while (pNode.m_pNextSibling != null)
127:                                pNode = pNode.m_pNextSibling;
128:
129:                            return pNode;
130:                        }
131:                    }
132:                }
133:                return m_pPrevSibling;
134:            }
135:
136:            /**
137:             * gets the first child node
138:             * @return first child as type TreeNode
139:             */
140:            public TreeNode getFirstChild() {
141:                if (m_pFirstChild != null && getFilterLevel() > 0) {
142:                    if (getUnfilteredDistanceFromRoot() == (getFilterLevel() - 1))
143:                        return m_pFirstChild.m_pFirstChild;
144:                }
145:
146:                return m_pFirstChild;
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.