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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/ControlFrame.java,v 1.1 2005/04/20 21:04:19 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 Java 3D(tm) Fly Through.
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.j3dfly;
019:
020:        import java.awt.Cursor;
021:        import java.util.ArrayList;
022:
023:        import javax.swing.JFileChooser;
024:        import javax.swing.JLabel;
025:        import javax.swing.JComboBox;
026:        import javax.swing.JOptionPane;
027:        import javax.swing.SwingUtilities;
028:        import javax.swing.ProgressMonitor;
029:
030:        import javax.media.j3d.BranchGroup;
031:        import javax.media.j3d.BoundingSphere;
032:        import javax.media.j3d.Bounds;
033:        import javax.media.j3d.TransformGroup;
034:        import javax.media.j3d.View;
035:        import javax.media.j3d.Transform3D;
036:        import javax.media.j3d.BoundingSphere;
037:        import javax.media.j3d.PolygonAttributes;
038:        import javax.media.j3d.DirectionalLight;
039:        import javax.media.j3d.Node;
040:        import javax.media.j3d.ViewPlatform;
041:
042:        import javax.vecmath.Point3d;
043:        import javax.vecmath.Vector3d;
044:        import javax.vecmath.Color3f;
045:        import javax.vecmath.Vector3f;
046:
047:        import com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior;
048:        import com.sun.j3d.utils.behaviors.vp.OrbitBehavior;
049:
050:        import org.jdesktop.j3dfly.warp.WarpSet;
051:        import org.jdesktop.j3dfly.warp.WarpEditorDialog;
052:
053:        import org.jdesktop.j3dfly.utils.loadercontrol.LoaderControl;
054:        import org.jdesktop.j3dfly.utils.loadercontrol.LoaderControlListener;
055:        import org.jdesktop.j3dfly.utils.vpbehaviors.HoverBehavior;
056:        import org.jdesktop.j3dfly.utils.vpbehaviors.FlyBehavior;
057:        import org.jdesktop.j3dfly.utils.vpbehaviors.VPCollisionBehavior;
058:        import org.jdesktop.j3dfly.utils.vpbehaviors.VPDefaultCollision;
059:        import org.jdesktop.j3dfly.utils.vpbehaviors.VPDriveCollision;
060:        import org.jdesktop.j3dfly.utils.vpbehaviors.ViewUtils;
061:        import org.jdesktop.j3dfly.utils.vpbehaviors.SimpleSweptVolume;
062:
063:        import org.jdesktop.j3d.utils.scenegraph.traverser.ChangePolygonAttributes;
064:        import org.jdesktop.j3d.utils.scenegraph.traverser.ChangeTextureAttributes;
065:        import org.jdesktop.j3d.utils.scenegraph.traverser.TreeScan;
066:        import org.jdesktop.j3d.utils.scenegraph.traverser.ChangeMaterial;
067:        import org.jdesktop.j3d.utils.scenegraph.traverser.NodeChangeProcessor;
068:        import org.jdesktop.j3d.utils.scenegraph.traverser.BehaviorSetEnable; //import com.sun.j3d.demos.utils.scenegraph.io.SceneGraphFileWriter;
069:        import org.jdesktop.j3dfly.utils.loadercontrol.ExampleFileFilter;
070:        import org.jdesktop.j3dfly.utils.loaderwrappers.J3fLoaderListener;
071:        import org.jdesktop.j3dfly.utils.loaderwrappers.J3fLoader;
072:        import org.jdesktop.j3dfly.utils.gui.StatsDialog;
073:        import org.jdesktop.j3dfly.utils.gui.FloatDocument;
074:        import org.jdesktop.j3dfly.utils.gui.WorkingDialog;
075:        import org.jdesktop.j3dfly.utils.environment.J3dSky;
076:
077:        import org.jdesktop.j3dfly.namecontrol.NameControl;
078:        import org.jdesktop.j3dfly.event.EventProcessor;
079:        import org.jdesktop.j3dfly.event.FileLoadEvent;
080:
081:        /**
082:         * @author Paul Byrne
083:         * @version $Revision: 1.1 $
084:         */
085:        public class ControlFrame extends javax.swing.JFrame {
086:
087:            private J3dFlyContext context;
088:
089:            private StatsDialog statsDialog = null;
090:            private Cursor normalCursor;
091:            private int showAllAxis = 0;
092:
093:            private J3dFlyController controller;
094:
095:            /** Creates new form controlPanel */
096:            public ControlFrame(J3dFlyContext context,
097:                    J3dFlyController controller) {
098:                this .context = context;
099:                this .controller = controller;
100:                initComponents();
101:
102:                javax.swing.ToolTipManager.sharedInstance()
103:                        .setLightWeightPopupEnabled(false);
104:
105:                this .setTitle("Sun Java 3D(tm) Fly Through 2.0beta "
106:                        + Version.version);
107:                pack();
108:            }
109:
110:            /**
111:             * Return the Panel in which plugins can place tool bars
112:             */
113:            public javax.swing.JPanel getToolBarPanel() {
114:                return toolBarPanel;
115:            }
116:
117:            /** This method is called from within the constructor to
118:             * initialize the form.
119:             * WARNING: Do NOT modify this code. The content of this method is
120:             * always regenerated by the FormEditor.
121:             */
122:            private void initComponents() {//GEN-BEGIN:initComponents
123:                toolBarPanel = new javax.swing.JPanel();
124:
125:                getContentPane().setLayout(new java.awt.GridBagLayout());
126:
127:                toolBarPanel.setLayout(new java.awt.BorderLayout());
128:
129:                toolBarPanel.setMinimumSize(new java.awt.Dimension(400, 100));
130:                toolBarPanel.setPreferredSize(new java.awt.Dimension(400, 100));
131:                getContentPane().add(toolBarPanel,
132:                        new java.awt.GridBagConstraints());
133:
134:            }//GEN-END:initComponents
135:
136:            private void stripifyBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stripifyBActionPerformed
137:            // Add your handling code here:
138:                java.awt.Frame frame = (java.awt.Frame) javax.swing.SwingUtilities
139:                        .getAncestorOfClass(java.awt.Frame.class, this );
140:
141:                StripifyWorker worker = new StripifyWorker(frame, context
142:                        .getLocale(), controller.getBranchGraphs(null),
143:                        statsDialog);
144:                worker.start();
145:            }//GEN-LAST:event_stripifyBActionPerformed
146:
147:            private void saveBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBActionPerformed
148:            // Add your handling code here:
149:                controller.saveAsScene();
150:            }//GEN-LAST:event_saveBActionPerformed
151:
152:            private void backClipTFActionPerformed(
153:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backClipTFActionPerformed
154:            }//GEN-LAST:event_backClipTFActionPerformed
155:
156:            private void frontClipTFActionPerformed(
157:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_frontClipTFActionPerformed
158:            }//GEN-LAST:event_frontClipTFActionPerformed
159:
160:            private void backClipTFMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_backClipTFMouseExited
161:            }//GEN-LAST:event_backClipTFMouseExited
162:
163:            private void frontClipTFMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_frontClipTFMouseExited
164:            }//GEN-LAST:event_frontClipTFMouseExited
165:
166:            private void configureLoadersBActionPerformed(
167:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configureLoadersBActionPerformed
168:            // Add your handling code here:
169:                controller.configureLoaders(findFrame(this ));
170:            }//GEN-LAST:event_configureLoadersBActionPerformed
171:
172:            /**
173:             * Return the frame which contains the component
174:             *
175:             * If component is not in a frame null is returned
176:             */
177:            private java.awt.Frame findFrame(java.awt.Component component) {
178:                java.awt.Frame ret = null;
179:                java.awt.Component comp = component;
180:
181:                while (ret == null && comp != null) {
182:                    if (comp instanceof  java.awt.Frame) {
183:                        ret = (java.awt.Frame) comp;
184:                    } else {
185:                        comp = comp.getParent();
186:                    }
187:                }
188:
189:                return ret;
190:            }
191:
192:            /**
193:             * Remove all geometry from the scenegraph
194:             */
195:            private void clearBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearBActionPerformed
196:            // Add your handling code here:
197:                /*
198:                filenameTF.setText("");
199:                controller.clearUniverse();
200:                
201:                saveB.setEnabled( true );
202:                compileB.setEnabled( true );
203:                stripifyB.setEnabled( true );
204:
205:                controller.clearUniverse();
206:                 */
207:                //if (statsDialog!=null)
208:                //    statsDialog.calcGeometryStats( (BranchGroup)null );        // Clear the stats
209:                //universe.setLive(true);
210:            }//GEN-LAST:event_clearBActionPerformed
211:
212:            /**
213:             * Compile the scenegraph.
214:             * Disable all J3dFly features which are unavailable after compile
215:             */
216:            private void compileBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_compileBActionPerformed
217:            // Add your handling code here:
218:                int response = javax.swing.JOptionPane
219:                        .showConfirmDialog(
220:                                this .getParent(),
221:                                "Compiled Scene Graphs cannot be Serialized or changed.\n\nProceed ?",
222:                                "WARNING",
223:                                javax.swing.JOptionPane.YES_NO_OPTION,
224:                                javax.swing.JOptionPane.WARNING_MESSAGE);
225:
226:                if (response == javax.swing.JOptionPane.YES_OPTION) {
227:                    Cursor origCursor = this .getParent().getCursor();
228:                    this .getParent().setCursor(
229:                            Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
230:                    context.getLocale().setLive(false);
231:                    BranchGroup[] graphs = controller.getBranchGraphs(null);
232:                    for (int i = 0; i < graphs.length; i++) {
233:                        ((BranchGroup) graphs[i]).compile();
234:                    }
235:                    context.getLocale().setLive(true);
236:                    this .getParent().setCursor(origCursor);
237:                }
238:            }//GEN-LAST:event_compileBActionPerformed
239:
240:            /**
241:             * Show the Statistics dialog
242:             */
243:            int distanceLOD = 0;
244:
245:            private void statisticsBActionPerformed(
246:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statisticsBActionPerformed
247:            // Add your handling code here:
248:                controller.showStatsDialog(this .getParent());
249:            }//GEN-LAST:event_statisticsBActionPerformed
250:
251:            /**
252:             * Load some geometry into the SceneGraph
253:             */
254:            private void loadBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loadBActionPerformed
255:            // Add your handling code here:
256:                controller.loadScene();
257:            }//GEN-LAST:event_loadBActionPerformed
258:
259:            /**
260:             * Move the view platform so that all geometry fit inside view frustum
261:             */
262:            // Variables declaration - do not modify//GEN-BEGIN:variables
263:            private javax.swing.JPanel toolBarPanel;
264:            // End of variables declaration//GEN-END:variables
265:
266:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.