Source Code Cross Referenced for SharedGroup.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » 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 » javax.media.j3d 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: SharedGroup.java,v $
003:         *
004:         * Copyright 1996-2008 Sun Microsystems, Inc.  All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
006:         *
007:         * This code is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU General Public License version 2 only, as
009:         * published by the Free Software Foundation.  Sun designates this
010:         * particular file as subject to the "Classpath" exception as provided
011:         * by Sun in the LICENSE file that accompanied this code.
012:         *
013:         * This code is distributed in the hope that it will be useful, but WITHOUT
014:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
015:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
016:         * version 2 for more details (a copy is included in the LICENSE file that
017:         * accompanied this code).
018:         *
019:         * You should have received a copy of the GNU General Public License version
020:         * 2 along with this work; if not, write to the Free Software Foundation,
021:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
022:         *
023:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
024:         * CA 95054 USA or visit www.sun.com if you need additional information or
025:         * have any questions.
026:         *
027:         * $Revision: 1.6 $
028:         * $Date: 2008/02/28 20:17:30 $
029:         * $State: Exp $
030:         */
031:
032:        package javax.media.j3d;
033:
034:        /**
035:         * The SharedGroup provides the ability to manipulate an
036:         * instanced scene graph.
037:         * A SharedGroup node allows multiple Link leaf nodes to share its
038:         * subgraph according to the following semantics:
039:         * <P><UL>
040:         * <LI>A SharedGroup may be referenced by one or more Link leaf
041:         * nodes. Any runtime changes to a node or component object in this
042:         * shared subgraph affect all graphs that refer to this subgraph.</LI><P>
043:         *
044:         * <LI>A SharedGroup may be compiled by calling its compile method
045:         * prior to being referenced by any Link leaf nodes.</LI><P>
046:         *
047:         * <LI>Only Link leaf nodes may refer to SharedGroup nodes. A
048:         * SharedGroup node cannot have parents or be attached to a Locale.</LI><P>
049:         * </UL>
050:         *
051:         * A shared subgraph may contain any group node, except an embedded
052:         * SharedGroup node (SharedGroup nodes cannot have parents). However,
053:         * only the following leaf nodes may appear in a shared subgraph:
054:         * <P><UL>
055:         * <LI>Light</LI>
056:         * <LI>Link</LI>
057:         * <LI>Morph</LI>
058:         * <LI>Shape</LI>
059:         * <LI>Sound</LI></UL><P>
060:         *
061:         * An IllegalSharingException is thrown if any of the following leaf nodes
062:         * appear in a shared subgraph:<P>
063:         * <UL>
064:         * <LI>AlternateAppearance</LI>
065:         * <LI>Background</LI>
066:         * <LI>Behavior</LI>
067:         * <LI>BoundingLeaf</LI>
068:         * <LI>Clip</LI>
069:         * <LI>Fog</LI>
070:         * <LI>ModelClip</LI>
071:         * <LI>Soundscape</LI>
072:         * <LI>ViewPlatform</LI></UL>
073:         * <P>
074:         *
075:         * @see IllegalSharingException
076:         */
077:
078:        public class SharedGroup extends Group {
079:
080:            /**
081:             * Specifies that this SharedGroup node allows reading the
082:             * list of links that refer to this node.
083:             *
084:             * @since Java 3D 1.3
085:             */
086:            public static final int ALLOW_LINK_READ = CapabilityBits.SHARED_GROUP_ALLOW_LINK_READ;
087:
088:            // Array for setting default read capabilities
089:            private static final int[] readCapabilities = { ALLOW_LINK_READ };
090:
091:            /**
092:             * Constructs and initializes a new SharedGroup node object.
093:             */
094:            public SharedGroup() {
095:                // set default read capabilities
096:                setDefaultReadCapabilities(readCapabilities);
097:            }
098:
099:            /**
100:             * Returns the list of Link nodes that refer to this SharedGroup node.
101:             * @return An array of Link nodes that refer to this SharedGroup node. 
102:             *
103:             * @since Java 3D 1.3
104:             */
105:            public Link[] getLinks() {
106:                if (isLiveOrCompiled()) {
107:                    if (!this .getCapability(ALLOW_LINK_READ)) {
108:                        throw new CapabilityNotSetException(J3dI18N
109:                                .getString("SharedGroup1"));
110:                    }
111:                }
112:                return ((SharedGroupRetained) retained).getLinks();
113:            }
114:
115:            /**
116:             * Creates the retained mode SharedGroupRetained object that this
117:             * SharedGroup component object will point to.
118:             */
119:            void createRetained() {
120:                this .retained = new SharedGroupRetained();
121:                this .retained.setSource(this );
122:            }
123:
124:            /**
125:             * Compiles the source SharedGroup associated with this object and
126:             * creates and caches a compiled scene graph.
127:             * @exception SceneGraphCycleException if there is a cycle in the
128:             * scene graph
129:             * @exception RestrictedAccessException if the method is called
130:             * when this object is part of a live scene graph.
131:             */
132:            public void compile() {
133:                if (isLive()) {
134:                    throw new RestrictedAccessException(J3dI18N
135:                            .getString("SharedGroup0"));
136:                }
137:
138:                if (isCompiled() == false) {
139:                    // will throw SceneGraphCycleException if there is a cycle
140:                    // in the scene graph
141:                    checkForCycle();
142:
143:                    ((SharedGroupRetained) this .retained).compile();
144:                }
145:            }
146:
147:            /**
148:             * Used to create a new instance of the node.  This routine is called
149:             * by <code>cloneTree</code> to duplicate the current node.
150:             * @param forceDuplicate when set to <code>true</code>, causes the
151:             *  <code>duplicateOnCloneTree</code> flag to be ignored.  When
152:             *  <code>false</code>, the value of each node's
153:             *  <code>duplicateOnCloneTree</code> variable determines whether
154:             *  NodeComponent data is duplicated or copied.
155:             *
156:             * @see Node#cloneTree
157:             * @see Node#cloneNode
158:             * @see Node#duplicateNode
159:             * @see NodeComponent#setDuplicateOnCloneTree
160:             */
161:            public Node cloneNode(boolean forceDuplicate) {
162:                SharedGroup sg = new SharedGroup();
163:                sg.duplicateNode(this, forceDuplicate);
164:                return sg;
165:            }
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.