Source Code Cross Referenced for XTreeNode.java in  » Net » Terracotta » com » tc » admin » common » 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 » Net » Terracotta » com.tc.admin.common 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice.  All rights reserved.
003:         */
004:        package com.tc.admin.common;
005:
006:        import java.awt.Toolkit;
007:        import java.awt.event.MouseEvent;
008:
009:        import javax.swing.ActionMap;
010:        import javax.swing.Icon;
011:        import javax.swing.InputMap;
012:        import javax.swing.JPopupMenu;
013:        import javax.swing.KeyStroke;
014:        import javax.swing.event.TreeSelectionEvent;
015:        import javax.swing.tree.DefaultMutableTreeNode;
016:        import javax.swing.tree.DefaultTreeModel;
017:        import javax.swing.tree.TreeCellRenderer;
018:        import javax.swing.tree.TreeNode;
019:
020:        public class XTreeNode extends DefaultMutableTreeNode {
021:            private TreeCellRenderer m_renderer;
022:            private Icon m_icon;
023:            private ActionMap m_actionMap;
024:            private InputMap m_inputMap;
025:
026:            protected static final int MENU_SHORTCUT_KEY_MASK = Toolkit
027:                    .getDefaultToolkit().getMenuShortcutKeyMask();
028:
029:            public XTreeNode() {
030:                super ();
031:            }
032:
033:            public XTreeNode(Object userObject) {
034:                super (userObject);
035:            }
036:
037:            public TreeCellRenderer getRenderer() {
038:                return m_renderer;
039:            }
040:
041:            public void setRenderer(TreeCellRenderer renderer) {
042:                m_renderer = renderer;
043:            }
044:
045:            public Icon getIcon() {
046:                return m_icon;
047:            }
048:
049:            public void setIcon(Icon icon) {
050:                m_icon = icon;
051:            }
052:
053:            public JPopupMenu getPopupMenu() {
054:                return null;
055:            }
056:
057:            public void tearDownChildren() {
058:                if (children != null) {
059:                    XTreeNode node;
060:
061:                    for (int i = getChildCount() - 1; i >= 0; i--) {
062:                        if ((node = (XTreeNode) children.get(i)) != null) {
063:                            node.tearDown();
064:                            node.removeFromParent();
065:                        }
066:                    }
067:                }
068:            }
069:
070:            public void tearDown() {
071:                tearDownChildren();
072:                setUserObject(null);
073:                setIcon(null);
074:            }
075:
076:            public ActionMap getActionMap() {
077:                return m_actionMap;
078:            }
079:
080:            public ActionMap ensureActionMap() {
081:                if (m_actionMap == null) {
082:                    m_actionMap = new ActionMap();
083:                }
084:
085:                return m_actionMap;
086:            }
087:
088:            public void setActionMap(ActionMap actionMap) {
089:                m_actionMap = actionMap;
090:            }
091:
092:            public InputMap getInputMap() {
093:                return m_inputMap;
094:            }
095:
096:            public InputMap ensureInputMap() {
097:                if (m_inputMap == null) {
098:                    m_inputMap = new InputMap();
099:                }
100:
101:                return m_inputMap;
102:            }
103:
104:            public void setInputMap(InputMap inputMap) {
105:                m_inputMap = inputMap;
106:            }
107:
108:            public void addActionBinding(Object binding, XAbstractAction action) {
109:                ensureActionMap().put(binding, action);
110:
111:                KeyStroke ks = action.getAccelerator();
112:                if (ks != null) {
113:                    ensureInputMap().put(ks, binding);
114:                }
115:            }
116:
117:            public XTreeModel getModel() {
118:                TreeNode root = getRoot();
119:                XTreeModel model = null;
120:
121:                if (root instanceof  XRootNode) {
122:                    model = ((XRootNode) getRoot()).getModel();
123:                }
124:
125:                return model;
126:            }
127:
128:            public int getIndex() {
129:                XTreeNode parentNode = (XTreeNode) getParent();
130:                return (parentNode != null) ? parentNode.getIndex(this ) : -1;
131:            }
132:
133:            public void nodeSelected(TreeSelectionEvent e) {/**/
134:            }
135:
136:            public void nodeClicked(MouseEvent me) {/**/
137:            }
138:
139:            protected void nodeChanged() {
140:                DefaultTreeModel model = getModel();
141:                if (model != null) {
142:                    model.nodeChanged(this );
143:                }
144:            }
145:
146:            protected void nodeStructureChanged() {
147:                DefaultTreeModel model = getModel();
148:                if (model != null) {
149:                    model.nodeStructureChanged(this);
150:                }
151:            }
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.