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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/nodeeditors/panels/Shape3DPanel.java,v 1.1 2005/04/20 22:21:09 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.panels;
019:
020:        import java.awt.Frame;
021:        import java.awt.image.BufferedImage;
022:        import javax.media.j3d.*;
023:        import org.jdesktop.j3dedit.scenegraph.SGNode;
024:        import org.jdesktop.j3dedit.scenegraph.SGShape3D;
025:        import org.jdesktop.j3dedit.scenegraph.SGNodeComponent;
026:        import org.jdesktop.j3dedit.scenegrapheditor.nodeeditors.NodeEditorPanel;
027:        import org.jdesktop.j3dedit.scenegrapheditor.nodeeditors.EditorPanelContainer;
028:
029:        /**
030:         * @author Paul Byrne
031:         * @version $id$
032:         */
033:        public class Shape3DPanel extends NodeEditorPanel {
034:
035:            AppearancePanel appearancePanel;
036:
037:            public Shape3DPanel() {
038:                super ();
039:                initComponents();
040:                frameTitle = "Shape3D";
041:                appearancePanel = new AppearancePanel();
042:
043:                appearanceP.add(appearancePanel);
044:            }
045:
046:            public void startEdit(SGNode node, EditorPanelContainer frame) {
047:                this .node = node;
048:                parentFrame = frame;
049:                parentFrame.setTitle(frameTitle);
050:
051:                Shape3D shape = (Shape3D) node.getJ3dNode();
052:
053:                appearancePanel.startEdit(((SGShape3D) node).getSGAppearance(),
054:                        node, this );
055:
056:                setControls();
057:            }
058:
059:            public void setReadOnly(boolean readOnly) {
060:                this .readOnly = readOnly;
061:
062:                appearancePanel.setReadOnly(readOnly);
063:            }
064:
065:            /**
066:             * Ensure that all of the sub components of Appearance have
067:             * a value other than null
068:             */
069:            /*
070:            private void ensureNoNulls( Shape3D shape ) {
071:                Appearance app = shape.getAppearance();
072:            if (app==null) {
073:                app = new Appearance();
074:                shape.setAppearance( app );
075:            }
076:
077:                if (app.getMaterial()==null) {
078:                    Material mat = new Material();
079:                    app.setMaterial( mat );
080:                }
081:                if (app.getColoringAttributes()==null)
082:                    app.setColoringAttributes( new ColoringAttributes() );
083:                if (app.getTransparencyAttributes()==null)
084:                    app.setTransparencyAttributes( new TransparencyAttributes() );
085:                if (app.getRenderingAttributes()==null)
086:                    app.setRenderingAttributes( new RenderingAttributes() );
087:                if (app.getPolygonAttributes()==null)
088:                    app.setPolygonAttributes( new PolygonAttributes() );
089:                if (app.getLineAttributes()==null)
090:                    app.setLineAttributes( new LineAttributes() );
091:                if (app.getPointAttributes()==null)
092:                    app.setPointAttributes( new PointAttributes() );
093:                if (app.getTextureAttributes()==null)
094:                    app.setTextureAttributes( new TextureAttributes() );
095:                if (app.getTexture()==null) {
096:                    Texture texture = new Texture2D( Texture.BASE_LEVEL, Texture.RGB,
097:                                                    2,2 );
098:                    texture.setImage( 0, new ImageComponent2D( 
099:                                              ImageComponent2D.FORMAT_RGB,
100:                                              new BufferedImage( 2, 2, 
101:                                              BufferedImage.TYPE_INT_RGB )));
102:                    texture.setEnable( false);
103:                    app.setTexture(texture);
104:                }
105:
106:            }*/
107:
108:            /** This method is called from within the constructor to
109:             * initialize the form.
110:             * WARNING: Do NOT modify this code. The content of this method is
111:             * always regenerated by the FormEditor.
112:             */
113:            private void initComponents() {//GEN-BEGIN:initComponents
114:                appearanceP = new javax.swing.JPanel();
115:
116:                setLayout(new java.awt.BorderLayout());
117:
118:                add(appearanceP, java.awt.BorderLayout.CENTER);
119:
120:            }//GEN-END:initComponents
121:
122:            /**
123:             * Set the GUI controls to represent node
124:             * Store the state of the node so any subsequent changes
125:             * can be reset
126:             */
127:            protected void setControls() {
128:                appearancePanel.setControls();
129:                setUpdateRequired(false);
130:            }
131:
132:            public void applyChanges() {
133:                appearancePanel.applyChanges();
134:                setUpdateRequired(false);
135:            }
136:
137:            public void resetChanges() {
138:                appearancePanel.resetChanges();
139:                setUpdateRequired(false);
140:            }
141:
142:            /**
143:             * Set capability bits for read-only operations on this
144:             * Nodes properties
145:             */
146:            protected void setReadCapabilityBits(Node node) {
147:
148:                Shape3D shape = (Shape3D) node;
149:                shape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
150:
151:                appearancePanel.setReadCapabilityBits(shape.getAppearance());
152:
153:            }
154:
155:            /**
156:             * Set capability bits for write-only operations on this
157:             * Nodes properties.
158:             *
159:             * This will probably only be used by setReadWriteCapabilityBits
160:             */
161:            protected void setReadWriteCapabilityBits(Node node) {
162:
163:                // In the event of the NodeComponents being shared with other Shape3D
164:                // which are live, each NodeComponent panel must return without error
165:                // even if the NodeComponnet is live.
166:
167:                Shape3D shape = (Shape3D) node;
168:                shape.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
169:                shape.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
170:                shape.setCapability(Shape3D.ALLOW_APPEARANCE_OVERRIDE_WRITE);
171:                shape.setCapability(Shape3D.ALLOW_APPEARANCE_OVERRIDE_READ);
172:                appearancePanel.setReadWriteCapabilityBits(shape
173:                        .getAppearance());
174:
175:            }
176:
177:            // Variables declaration - do not modify//GEN-BEGIN:variables
178:            private javax.swing.JPanel appearanceP;
179:            // End of variables declaration//GEN-END:variables
180:
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.