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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/editormodules/J3dFlyEditorModule.java,v 1.1 2005/04/20 22:20:30 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.editormodules;
019:
020:        import org.jdesktop.j3dfly.J3dFly;
021:        import org.jdesktop.j3dfly.J3dFlyContext;
022:        import org.jdesktop.j3dedit.J3dEdit;
023:        import org.jdesktop.j3dedit.J3dEditContext;
024:        import org.jdesktop.j3dfly.J3dFlyController;
025:        import javax.media.j3d.Transform3D;
026:        import com.sun.j3d.utils.universe.SimpleUniverse;
027:
028:        /**
029:         * This module is a special module and does not follow the normal module
030:         * rules. For example the module even when not active is used by other
031:         * modules to display the universe.
032:         *
033:         * @author  paulby
034:         * @version $Id: J3dFlyEditorModule.java,v 1.1 2005/04/20 22:20:30 paulby Exp $
035:         */
036:        public class J3dFlyEditorModule extends AbstractEditorModule {
037:
038:            protected J3dFly j3dFly;
039:            protected J3dEdit j3dEdit;
040:
041:            /** Creates new J3dFlyEditorModule */
042:            public J3dFlyEditorModule(J3dEdit j3dEdit,
043:                    javax.swing.JPanel toolbarPanel) {
044:                this (j3dEdit, toolbarPanel, null);
045:            }
046:
047:            /** 
048:             *  
049:             * @params universe When using the interposer this will contain the users universe
050:             *                  otherwise it should be null
051:             */
052:            public J3dFlyEditorModule(J3dEdit j3dEdit,
053:                    javax.swing.JPanel toolbarPanel, SimpleUniverse universe) {
054:                j3dFly = new J3dFly(
055:                        j3dEdit.getMainMenuBar(),
056:                        toolbarPanel,
057:                        false,
058:                        null,
059:                        J3dEditContext.class,
060:                        new org.jdesktop.j3dedit.scenegrapheditor.VisualToolManager(),
061:                        universe);
062:                this .j3dEdit = j3dEdit;
063:                j3dFly.getController().setCollisionEnabled(false);
064:                Transform3D initialPos = new Transform3D();
065:                initialPos.set(1.0, new javax.vecmath.Vector3d(0, 0, 20));
066:                j3dFly.getUniverse().getViewingPlatform()
067:                        .getViewPlatformTransform().setTransform(initialPos);
068:            }
069:
070:            protected J3dFlyEditorModule() {
071:            }
072:
073:            /**
074:             * Return the name of the module.
075:             *
076:             * The name will be used in the mode button for selecting this
077:             * module
078:             */
079:            public String getModuleName() {
080:                return "View Universe";
081:            }
082:
083:            /**
084:             * Activate/Deactive this module.
085:             *
086:             * When a module is activated this method will create, display and
087:             * arrange all the windows.
088:             *
089:             * When deactived the windows are hidden and possibly destroyed
090:             */
091:            public void setActive(boolean active) {
092:                System.out.println("J3dFlyEditorModule active:" + active);
093:                if (active) {
094:                    java.awt.Container container = j3dFly.getContainer();
095:                    java.awt.Dimension screenSize = container.getToolkit()
096:                            .getScreenSize();
097:                    int controlFrameEdge = j3dEdit.getEditorControlFrame()
098:                            .getWidth();
099:
100:                    container.setLocation(controlFrameEdge,
101:                            j3dEdit.getSize().height);
102:                    container.setSize(screenSize.width - controlFrameEdge,
103:                            screenSize.height - j3dEdit.getSize().height);
104:                    container.setVisible(true);
105:                }
106:            }
107:
108:            /** 
109:             * Set the visible propert of the J3dFly window
110:             */
111:            public void setVisible(boolean visible) {
112:                j3dFly.getContainer().setVisible(visible);
113:            }
114:
115:            /**
116:             * Get the controller class for J3dFly
117:             */
118:            public J3dFlyController getController() {
119:                return j3dFly.getController();
120:            }
121:
122:            /**
123:             * Get the Universe
124:             */
125:            public J3dEditContext getContext() {
126:                return (J3dEditContext) j3dFly.getCurrentContext();
127:            }
128:
129:            /** 
130:             * Set the bounds of the window
131:             */
132:            public void setBounds(int x, int y, int width, int height) {
133:                j3dFly.getContainer().setBounds(x, y, width, height);
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.