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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/interposer/InterposerUniverse.java,v 1.1 2005/04/20 22:20:32 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.interposer;
019:
020:        import java.util.Enumeration;
021:        import javax.media.j3d.VirtualUniverse;
022:        import javax.media.j3d.Locale;
023:        import javax.media.j3d.BranchGroup;
024:        import javax.media.j3d.Canvas3D;
025:        import com.sun.j3d.utils.universe.SimpleUniverse;
026:        import com.sun.j3d.utils.universe.Viewer;
027:        import com.sun.j3d.utils.universe.ViewingPlatform;
028:
029:        import org.jdesktop.j3dfly.utils.developmenttools.DevelopmentLocale;
030:        import org.jdesktop.j3dfly.J3dFlyContext;
031:
032:        /**
033:         * This universe is used to 'wrap' a real universe provided by the user.
034:         * The users universe is assumed to NOT be derrived from SimpleUniverse so
035:         * this wrapper provides the SimpleUniverse features that J3dFly requires
036:         *
037:         * @author  Paul Byrne
038:         * @version $Id: InterposerUniverse.java,v 1.1 2005/04/20 22:20:32 paulby Exp $
039:         */
040:        public class InterposerUniverse extends SimpleUniverse {
041:
042:            private VirtualUniverse userUniverse;
043:            private Locale devLocale;
044:            private DevelopmentLocale hiddenLocale;
045:
046:            private Viewer viewer;
047:            private ViewingPlatform vwp;
048:
049:            /** Creates a new instance of InterposerUniverse */
050:            public InterposerUniverse(VirtualUniverse userUniverse,
051:                    DevelopmentLocale devLocale) {
052:                super ();
053:                this .devLocale = devLocale;
054:                this .userUniverse = userUniverse;
055:
056:                this .removeAllLocales();
057:                setupHiddenLocale();
058:            }
059:
060:            public Locale getLocale() {
061:                return devLocale;
062:            }
063:
064:            private void setupHiddenLocale() {
065:                // This locale just contains the J3dFly view portion of the SG.
066:                hiddenLocale = new DevelopmentLocale(userUniverse);
067:
068:                vwp = new ViewingPlatform(1);
069:                viewer = new Viewer(null, null);
070:                viewer.setViewingPlatform(vwp);
071:                hiddenLocale.addBranchGraph(vwp);
072:            }
073:
074:            public void finishHiddenLocaleInit(J3dFlyContext context) {
075:                // Remove and reattach the vwp so that the editor sees the event and
076:                // creates the graph etc.
077:                hiddenLocale.removeBranchGraph(vwp);
078:                // Create structures for the extra Locale added by InterposerUniverse
079:                hiddenLocale
080:                        .setSceneGraphChangeListeners(((InterposerLocale) context
081:                                .getLocale(0)).getSceneGraphChangeListeners());
082:                context.addLocale(hiddenLocale);
083:                hiddenLocale.addBranchGraph(vwp);
084:            }
085:
086:            public Viewer getViewer() {
087:                return viewer;
088:            }
089:
090:            public ViewingPlatform getViewingPlatform() {
091:                return vwp;
092:            }
093:
094:            public Canvas3D getCanvas3D() {
095:                return getCanvas3D(0);
096:            }
097:
098:            public Canvas3D getCanvas3D(int canvasNum) {
099:                return viewer.getCanvas3D(canvasNum);
100:            }
101:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.