Source Code Cross Referenced for NodeComponentEditorPanel.java in  » 6.0-JDK-Modules » java-3d » org » jdesktop » j3dedit » scenegrapheditor » nodeeditors » 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 » 6.0 JDK Modules » java 3d » org.jdesktop.j3dedit.scenegrapheditor.nodeeditors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/nodeeditors/NodeComponentEditorPanel.java,v 1.1 2005/04/20 22:21:00 paulby Exp $
003:         *
004:         *                         Sun Public License Notice
005:         *
006:         *  The contents of this file are subject to the Sun Public License Version
007:         *  1.0 (the "License"). You may not use this file except in compliance with
008:         *  the License. A copy of the License is available at http://www.sun.com/
009:         *  
010:         *  The Original Code is the Java 3D(tm) Scene Graph Editor.
011:         *  The Initial Developer of the Original Code is Paul Byrne.
012:         *  Portions created by Paul Byrne are Copyright (C) 2002.
013:         *  All Rights Reserved.
014:         *  
015:         *  Contributor(s): Paul Byrne.
016:         *  
017:         **/
018:        package org.jdesktop.j3dedit.scenegrapheditor.nodeeditors;
019:
020:        import java.awt.Frame;
021:        import javax.swing.JPanel;
022:        import javax.media.j3d.NodeComponent;
023:        import javax.media.j3d.SceneGraphObject;
024:        import org.jdesktop.j3dedit.scenegraph.SGObject;
025:        import org.jdesktop.j3dedit.scenegraph.SGNodeComponent;
026:        import org.jdesktop.j3dedit.scenegraph.SGNode;
027:
028:        /**
029:         * Superclass for all Component Editors
030:         *
031:         * @author Paul Byrne
032:         * @version	1.5, 01/18/02
033:         */
034:        public abstract class NodeComponentEditorPanel extends JPanel {
035:
036:            /**
037:             * Reference to node which is being edited
038:             */
039:            protected SGNodeComponent node;
040:
041:            /**
042:             * EditorPanel in which thiscomponent editor is working
043:             */
044:            protected NodeEditorPanel parentEditor;
045:
046:            /**
047:             * The SceneGraphObject that contains this nodeComponents parent
048:             */
049:            protected SGObject nodeParent;
050:
051:            private boolean updateFlag; // Set true each time user changes GUI values
052:            protected boolean readOnly;
053:
054:            public NodeComponentEditorPanel() {
055:                super ();
056:            }
057:
058:            /**
059:             * Start editing this node
060:             *
061:             * @param node The NodeComponent being edited, can be null
062:             * @param nodeParent The SceneGraphObject that contains this component
063:             * @param parentWindow The EditorPanel for the parent Node
064:             */
065:            public void startEdit(SGNodeComponent node, SGObject nodeParent,
066:                    NodeEditorPanel parentWindow) {
067:                this .node = node;
068:                this .nodeParent = nodeParent;
069:
070:                parentEditor = parentWindow;
071:                getCommonNCPanel().startEdit(node);
072:                setControls();
073:            }
074:
075:            /**
076:             * Finish editing this node
077:             * This will cause any SGObjectExtraData to be set in this nodes SGObject.
078:             */
079:            public void finishEdit() {
080:                if (node != null)
081:                    node.setSGObjectExtraData(updateSGObjectExtraData(node
082:                            .getSGObjectExtraData()));
083:                parentEditor = null;
084:            }
085:
086:            /**
087:             * Set the panel to be read only, user can navigate the contents but
088:             * can not make any changes.
089:             * 
090:             * Default action is to call setEnabled on all components in this
091:             * container
092:             */
093:            public void setReadOnly(boolean readOnly) {
094:                this .readOnly = readOnly;
095:
096:                for (int i = 0; i < getComponentCount(); i++)
097:                    getComponent(i).setEnabled(!readOnly);
098:            }
099:
100:            /**
101:             * Return the readOnly flag
102:             */
103:            public boolean getReadOnly() {
104:                return readOnly;
105:            }
106:
107:            /**
108:             * Set the GUI controls for represent node
109:             */
110:            protected abstract void setControls();
111:
112:            /**
113:             * Permanently apply the changes to the node
114:             */
115:            public abstract void applyChanges();
116:
117:            /**
118:             * Reset the changes to the state when setControls or applyChanges
119:             * was last called
120:             */
121:            public abstract void resetChanges();
122:
123:            /**
124:             * Set the capabilities of this node to the correct values
125:             * depending on the Editor mode.
126:             *
127:             * Node must not be live
128:             */
129:            public void setEditorCapabilities(NodeComponent node) {
130:                if (org.jdesktop.j3dedit.scenegrapheditor.PropertiesDialog.performanceLevel == org.jdesktop.j3dedit.scenegrapheditor.PropertiesDialog.READ_WRITE_ALLOWED)
131:                    setReadWriteCapabilityBits(node);
132:                else if (org.jdesktop.j3dedit.scenegrapheditor.PropertiesDialog.performanceLevel == org.jdesktop.j3dedit.scenegrapheditor.PropertiesDialog.READ_ALLOWED)
133:                    setReadCapabilityBits(node);
134:
135:                // Don't set any capability bits for NONE_ALLOWED
136:            }
137:
138:            /**
139:             * Set capability bits for read-only operations on this
140:             * Nodes properties
141:             */
142:            protected abstract void setReadCapabilityBits(NodeComponent node);
143:
144:            /**
145:             * Set capability bits for full read/write access to this
146:             * nodes properties
147:             */
148:            protected abstract void setReadWriteCapabilityBits(
149:                    NodeComponent node);
150:
151:            /**
152:             * Called by NodeState when the user applies changes
153:             * or when changes need applying
154:             */
155:            protected void setUpdateRequired(boolean update) {
156:                updateFlag = update;
157:
158:                parentEditor.setUpdateRequired(update);
159:            }
160:
161:            /**
162:             * Returns true if the user has changed the state using the GUI
163:             */
164:            protected boolean getUpdateRequired() {
165:                return updateFlag;
166:            }
167:
168:            /**
169:             * If orig is not null then update it with the new information in the panel
170:             * If orig is null, and there is new information then create and return a
171:             * new SGObjectExtraData object
172:             */
173:            protected SGObjectExtraData updateSGObjectExtraData(
174:                    SGObjectExtraData orig) {
175:                return orig;
176:            }
177:
178:            /**
179:             * Get the J3d Node of this node components parent
180:             */
181:            protected javax.media.j3d.Node getParentJ3dNode() {
182:                return ((SGNode) nodeParent).getJ3dNode();
183:            }
184:
185:            /**
186:             * Get the J3d NodeComponent of this node components parent
187:             */
188:            protected javax.media.j3d.NodeComponent getParentJ3dNodeComponent() {
189:                return ((SGNodeComponent) nodeParent).getJ3dNode();
190:            }
191:
192:            /** 
193:             * Get the CommonNodeComponentPanel 
194:             */
195:            protected abstract org.jdesktop.j3dedit.scenegrapheditor.nodeeditors.panels.CommonNodeComponentPanel getCommonNCPanel();
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.