Source Code Cross Referenced for SceneGraphEditorModule.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/SceneGraphEditorModule.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.j3dedit.J3dEdit;
021:        import org.jdesktop.j3dedit.J3dEditContext;
022:        import org.jdesktop.j3dedit.scenegrapheditor.Editor;
023:        import org.jdesktop.j3dedit.scenegrapheditor.J3dTreePanel;
024:        import org.jdesktop.j3dedit.scenegrapheditor.ConfigLoader;
025:
026:        import javax.swing.JRadioButtonMenuItem;
027:        import javax.swing.ButtonGroup;
028:        import org.jdesktop.j3dedit.scenegraph.SGObject;
029:
030:        /**
031:         *
032:         * @author  paulby
033:         * @version
034:         */
035:        public class SceneGraphEditorModule extends AbstractEditorModule {
036:
037:            private Editor sgEditor = null;
038:            private J3dFlyEditorModule j3dFlyModule;
039:            private J3dEdit j3dEdit;
040:
041:            /** Creates new AnimationEditorModule */
042:            public SceneGraphEditorModule(J3dEdit j3dEdit,
043:                    J3dFlyEditorModule j3dFlyModule) {
044:                this .j3dFlyModule = j3dFlyModule;
045:                this .j3dEdit = j3dEdit;
046:                sgEditor = new Editor(j3dFlyModule.getContext(), false);
047:                j3dEdit.getLeftToolbarPanel().add(
048:                        j3dFlyModule.getContext().getConfigLoader()
049:                                .getJ3dNodesToolbar().getTabPane());
050:
051:                // Add packer to tab pane to force it to put all tabs on one line
052:                javax.swing.JPanel p = new javax.swing.JPanel();
053:                p.setPreferredSize(new java.awt.Dimension(250, 10));
054:                ((javax.swing.JPanel) j3dFlyModule.getContext()
055:                        .getConfigLoader().getJ3dNodesToolbar().getTabPane()
056:                        .getComponentAt(0)).add(p);
057:
058:            }
059:
060:            /**
061:             * Return the name of the module.
062:             *
063:             * The name will be used in the mode button for selecting this
064:             * module
065:             */
066:            public String getModuleName() {
067:                return "SceneGraph Editor";
068:            }
069:
070:            /**
071:             * Activate/Deactive this module.
072:             *
073:             * When a module is activated this method will create, display and
074:             * arrange all the windows.
075:             *
076:             * When deactived the windows are hidden and possibly destroyed
077:             */
078:            public void setActive(boolean active) {
079:                System.out.println("SceneGraph Editor active:" + active);
080:                if (active)
081:                    activate();
082:                else
083:                    deactivate();
084:            }
085:
086:            private void activate() {
087:                java.awt.Dimension screenSize = java.awt.Toolkit
088:                        .getDefaultToolkit().getScreenSize();
089:
090:                int controlFrameEdge = j3dEdit.getEditorControlFrame()
091:                        .getWidth();
092:
093:                int minY = j3dEdit.getSize().height; // Top of available area
094:                int midY = screenSize.height / 2 + minY / 2; // Mid point Y of available area
095:
096:                int flyX = controlFrameEdge + 600;
097:
098:                if (j3dFlyModule != null) {
099:                    j3dFlyModule.setBounds(flyX, minY + 350, screenSize.width
100:                            - flyX, midY - minY);
101:                    j3dFlyModule.setVisible(true);
102:                }
103:
104:                sgEditor.getTreeFrame().setBounds(controlFrameEdge, minY, 600,
105:                        600);
106:
107:                sgEditor.getEditorFrame().setBounds(flyX, minY,
108:                        screenSize.width - flyX, 350);
109:
110:                sgEditor.setActive(true);
111:            }
112:
113:            private void deactivate() {
114:                sgEditor.setActive(false);
115:            }
116:
117:            /**
118:             * Called when the module is added to the editor. The module should
119:             * add any menu items it requires to the menus in the menu bar.
120:             *
121:             */
122:            public void populateMenuBar(javax.swing.JMenuBar menuBar) {
123:                javax.swing.JMenu viewMenu = getMenu(j3dFlyModule, "View");
124:                sgEditor.updateViewMenu(viewMenu);
125:            }
126:
127:            /**
128:             * Make preperations to save a project
129:             *
130:             * The scenegraph will not be live when this method is called
131:             */
132:            public void prepareToSave() {
133:                sgEditor.prepareToSave();
134:            }
135:
136:            /**
137:             * Save operation is complete, return system to runtime state
138:             */
139:            public void saveComplete() {
140:                sgEditor.saveComplete();
141:            }
142:
143:            public SGObject getRoot() {
144:                return ((J3dEditContext) j3dFlyModule.getContext())
145:                        .getSceneGraphControl().getViewRoot();
146:            }
147:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.