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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/PropertiesDialog.java,v 1.1 2005/04/20 22:20:48 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;
019:
020:        import javax.media.j3d.Canvas3D;
021:
022:        /**
023:         * @author Paul Byrne
024:         * @version	1.6, 01/18/02
025:         */
026:        public class PropertiesDialog extends javax.swing.JDialog {
027:
028:            public static final int NONE_ALLOWED = 0; // Best Java3D performance
029:            public static final int READ_ALLOWED = 1; // ALLOW_READ set on all node parameters
030:            public static final int READ_WRITE_ALLOWED = 2; // ALLOW_READ and ALLOW_WRITE set on all node parameters
031:
032:            public static int performanceLevel = READ_WRITE_ALLOWED;
033:
034:            private boolean origStereoEnable;
035:            private boolean origDoubleBufferEnable;
036:
037:            private boolean gotOK; // Was the OK button pressed to exit
038:
039:            /** Creates new form PropertiesDialog */
040:            public PropertiesDialog(java.awt.Frame parent, boolean modal) {
041:                super (parent, modal);
042:                initComponents();
043:                pack();
044:
045:                javax.swing.ButtonGroup performanceGroup = new javax.swing.ButtonGroup();
046:                performanceGroup.add(minimumCapabilityRB);
047:                performanceGroup.add(readCapabilityRB);
048:                performanceGroup.add(readWriteCapabilityRB);
049:
050:                setPerformanceLevel(performanceLevel);
051:
052:            }
053:
054:            public void setPerformanceLevel(int level) {
055:                performanceLevel = level;
056:                switch (level) {
057:                case NONE_ALLOWED:
058:                    minimumCapabilityRB.setSelected(true);
059:                    break;
060:                case READ_ALLOWED:
061:                    readCapabilityRB.setSelected(true);
062:                    break;
063:                case READ_WRITE_ALLOWED:
064:                    readWriteCapabilityRB.setSelected(true);
065:                    break;
066:                default:
067:                    throw new RuntimeException("Bad Performance Level " + level);
068:                }
069:            }
070:
071:            /** This method is called from within the constructor to
072:             * initialize the form.
073:             * WARNING: Do NOT modify this code. The content of this method is
074:             * always regenerated by the FormEditor.
075:             */
076:            private void initComponents() {//GEN-BEGIN:initComponents
077:                java.awt.GridBagConstraints gridBagConstraints;
078:
079:                jPanel2 = new javax.swing.JPanel();
080:                okButton = new javax.swing.JButton();
081:                cancelButton = new javax.swing.JButton();
082:                jPanel5 = new javax.swing.JPanel();
083:                jPanel4 = new javax.swing.JPanel();
084:                stereoEnableCB = new javax.swing.JCheckBox();
085:                doubleBufferEnableCB = new javax.swing.JCheckBox();
086:                jPanel3 = new javax.swing.JPanel();
087:                minimumCapabilityRB = new javax.swing.JRadioButton();
088:                readCapabilityRB = new javax.swing.JRadioButton();
089:                readWriteCapabilityRB = new javax.swing.JRadioButton();
090:
091:                setModal(true);
092:                setName("PropertiesDialog");
093:                addWindowListener(new java.awt.event.WindowAdapter() {
094:                    public void windowClosing(java.awt.event.WindowEvent evt) {
095:                        closeDialog(evt);
096:                    }
097:
098:                    public void windowActivated(java.awt.event.WindowEvent evt) {
099:                        formWindowActivated(evt);
100:                    }
101:                });
102:
103:                okButton.setText("OK");
104:                okButton.addActionListener(new java.awt.event.ActionListener() {
105:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
106:                        okButtonActionPerformed(evt);
107:                    }
108:                });
109:
110:                jPanel2.add(okButton);
111:
112:                cancelButton.setText("Cancel");
113:                cancelButton
114:                        .addActionListener(new java.awt.event.ActionListener() {
115:                            public void actionPerformed(
116:                                    java.awt.event.ActionEvent evt) {
117:                                cancelButtonActionPerformed(evt);
118:                            }
119:                        });
120:
121:                jPanel2.add(cancelButton);
122:
123:                getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
124:
125:                jPanel5.setLayout(new java.awt.GridBagLayout());
126:
127:                jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4,
128:                        javax.swing.BoxLayout.Y_AXIS));
129:
130:                jPanel4.setBorder(new javax.swing.border.TitledBorder(
131:                        "Canvas3D Controls"));
132:                stereoEnableCB.setText("Stereo Enable");
133:                stereoEnableCB
134:                        .setToolTipText("Display Canvas3D contents in Stereo");
135:                stereoEnableCB
136:                        .addChangeListener(new javax.swing.event.ChangeListener() {
137:                            public void stateChanged(
138:                                    javax.swing.event.ChangeEvent evt) {
139:                                stereoEnableCBStateChanged(evt);
140:                            }
141:                        });
142:
143:                jPanel4.add(stereoEnableCB);
144:
145:                doubleBufferEnableCB.setText("Double Buffer Enable");
146:                doubleBufferEnableCB.setToolTipText("Enable Double Buffering");
147:                doubleBufferEnableCB
148:                        .addChangeListener(new javax.swing.event.ChangeListener() {
149:                            public void stateChanged(
150:                                    javax.swing.event.ChangeEvent evt) {
151:                                doubleBufferEnableStateChanged(evt);
152:                            }
153:                        });
154:
155:                jPanel4.add(doubleBufferEnableCB);
156:
157:                gridBagConstraints = new java.awt.GridBagConstraints();
158:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
159:                jPanel5.add(jPanel4, gridBagConstraints);
160:
161:                jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3,
162:                        javax.swing.BoxLayout.Y_AXIS));
163:
164:                jPanel3.setBorder(new javax.swing.border.TitledBorder(
165:                        new javax.swing.border.EtchedBorder(),
166:                        "Java3D Performance"));
167:                jPanel3
168:                        .setToolTipText("\nJava3D uses Capabilities to allow the runtime system to optimise\nthe SceneGraph for maximum performance. In general the\nfewer Capabilities set, the more optimisations can take place and\nhence better performance is achieved.\n\nThe Java3D Editor always maintains a record of the minimal \ncapability settings for a SceneGraph. However when the tool\noperates with these minimal settings all user interactions require\nthe scene graph to be detached from the universe, often causing\nflickering.\n\nThis dialog allows you to choose the level of capabilities used\nby the Java3D Editor during editing. The minimal capability settings\nwill be stored in the output file.");
169:                minimumCapabilityRB.setText("Minimum Capabilities");
170:                minimumCapabilityRB
171:                        .setToolTipText("Maximum Java3D Performance. The capabilities required to execute the SceneGraph are the only ones set.");
172:                jPanel3.add(minimumCapabilityRB);
173:
174:                readCapabilityRB.setText("Read Capabilities");
175:                readCapabilityRB
176:                        .setToolTipText("Intermediate Java3D Performance. Capabilites are set on all nodes to allow  their properties to be READ, any changes the user makes will require a scenegraph detach");
177:                jPanel3.add(readCapabilityRB);
178:
179:                readWriteCapabilityRB.setText("Read/Write Capabilities");
180:                readWriteCapabilityRB
181:                        .setToolTipText("Poorest Java3D Performance. All capabilities in the SceneGraph are set allowing all changes to be made dynamically");
182:                jPanel3.add(readWriteCapabilityRB);
183:
184:                gridBagConstraints = new java.awt.GridBagConstraints();
185:                gridBagConstraints.gridx = 0;
186:                gridBagConstraints.gridy = 1;
187:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
188:                jPanel5.add(jPanel3, gridBagConstraints);
189:
190:                getContentPane().add(jPanel5, java.awt.BorderLayout.CENTER);
191:
192:            }//GEN-END:initComponents
193:
194:            private void cancelButtonActionPerformed(
195:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
196:            // Add your handling code here:
197:                stereoEnableCB.setSelected(origStereoEnable);
198:                doubleBufferEnableCB.setSelected(origDoubleBufferEnable);
199:                this .hide();
200:            }//GEN-LAST:event_cancelButtonActionPerformed
201:
202:            private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
203:            // Add your handling code here:
204:                gotOK = true;
205:                this .hide();
206:            }//GEN-LAST:event_okButtonActionPerformed
207:
208:            /**
209:             * Return true if the user clicked on OK to close the Dialog
210:             */
211:            public boolean exitOK() {
212:                return gotOK;
213:            }
214:
215:            private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
216:            // Add your handling code here:
217:                /*
218:                Canvas3D canvas = WindowManager.getManager().getUserUniverse().getCanvas3D();
219:                stereoEnableCB.setEnabled( canvas.getStereoAvailable() );
220:                doubleBufferEnableCB.setEnabled( canvas.getDoubleBufferAvailable() );
221:                origStereoEnable = canvas.getStereoEnable();
222:                origDoubleBufferEnable = canvas.getDoubleBufferEnable();
223:                stereoEnableCB.setSelected( origStereoEnable );
224:                doubleBufferEnableCB.setSelected( origDoubleBufferEnable );    
225:                gotOK = false;
226:                 */
227:            }//GEN-LAST:event_formWindowActivated
228:
229:            private void doubleBufferEnableStateChanged(
230:                    javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_doubleBufferEnableStateChanged
231:            // Add your handling code here:
232:                /*
233:                Canvas3D canvas = WindowManager.getManager().getUserUniverse().getCanvas3D();
234:                canvas.setDoubleBufferEnable( doubleBufferEnableCB.isSelected() );
235:                 */
236:            }//GEN-LAST:event_doubleBufferEnableStateChanged
237:
238:            private void stereoEnableCBStateChanged(
239:                    javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_stereoEnableCBStateChanged
240:            // Add your handling code here:
241:                /*
242:                Canvas3D canvas = WindowManager.getManager().getUserUniverse().getCanvas3D();
243:                canvas.setStereoEnable( stereoEnableCB.isSelected() );
244:                 */
245:            }//GEN-LAST:event_stereoEnableCBStateChanged
246:
247:            /** Closes the dialog */
248:            private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
249:                setVisible(false);
250:                dispose();
251:            }//GEN-LAST:event_closeDialog
252:
253:            // Variables declaration - do not modify//GEN-BEGIN:variables
254:            private javax.swing.JRadioButton readCapabilityRB;
255:            private javax.swing.JPanel jPanel5;
256:            private javax.swing.JCheckBox stereoEnableCB;
257:            private javax.swing.JPanel jPanel4;
258:            private javax.swing.JPanel jPanel3;
259:            private javax.swing.JPanel jPanel2;
260:            private javax.swing.JRadioButton minimumCapabilityRB;
261:            private javax.swing.JCheckBox doubleBufferEnableCB;
262:            private javax.swing.JButton okButton;
263:            private javax.swing.JRadioButton readWriteCapabilityRB;
264:            private javax.swing.JButton cancelButton;
265:            // End of variables declaration//GEN-END:variables
266:
267:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.