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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegrapheditor/NameGenerator.java,v 1.1 2005/04/20 22:20:46 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.scenegrapheditor;
019:
020:        import javax.media.j3d.*;
021:        import com.sun.j3d.utils.behaviors.interpolators.KBRotPosScaleSplinePathInterpolator;
022:
023:        /**
024:         * Autogenerates names for the user.
025:         */
026:        public class NameGenerator {
027:
028:            private final static String GROUP = "grp";
029:            private final static String BRANCHGROUP = "bg";
030:            private final static String TRANSFORMGROUP = "tg";
031:            private final static String LIGHT = "light";
032:            private final static String BEHAVIOR = "behavior";
033:            private final static String INTERPOLATOR = "interp";
034:            private final static String OBJ_LOADER = "obj";
035:            private final static String LW3D_LOADER = "lw3d";
036:            private final static String SIMPLE_UNIVERSE = "u";
037:            private final static String SIMPLE_GEOM = "geom";
038:            private final static String ALPHA = "alpha";
039:            private final static String SOUND = "sound";
040:            private final static String FOG = "fog";
041:            private final static String KB_ROT_POS_INTERP = "kbInterp";
042:            private final static String BACKGROUND = "background";
043:
044:            private int light = 0;
045:            private int group = 0;
046:            private int branchGroup = 0;
047:            private int transformGroup = 0;
048:            private int behavior = 0;
049:            private int interpolator = 0;
050:            private int objLoader = 0;
051:            private int lw3dLoader = 0;
052:            private int simpleUniverse = 0;
053:            private int simpleGeom = 0;
054:            private int alpha = 0;
055:            private int sound = 0;
056:            private int kbInterp = 0;
057:            private int fog = 0;
058:            private int background = 0;
059:
060:            private int unknown = 0;
061:
062:            private static NameGenerator nameControl = null;
063:
064:            public NameGenerator() {
065:            }
066:
067:            public static NameGenerator getNameControl() {
068:                if (nameControl == null)
069:                    nameControl = new NameGenerator();
070:
071:                return nameControl;
072:            }
073:
074:            public String getGroupName() {
075:                return GROUP + group++;
076:            }
077:
078:            public String getBranchGroupName() {
079:                return BRANCHGROUP + branchGroup++;
080:            }
081:
082:            public String getTransformGroupName() {
083:                return TRANSFORMGROUP + transformGroup++;
084:            }
085:
086:            public String getBehaviorName() {
087:                return BEHAVIOR + behavior++;
088:            }
089:
090:            public String getInterpolaterName() {
091:                return INTERPOLATOR + interpolator++;
092:            }
093:
094:            public String getLightName() {
095:                return LIGHT + light++;
096:            }
097:
098:            public String getObjLoaderName() {
099:                return OBJ_LOADER + objLoader++;
100:            }
101:
102:            public String getLw3DLoaderName() {
103:                return LW3D_LOADER + lw3dLoader++;
104:            }
105:
106:            public String getSimpleUniverseName() {
107:                return SIMPLE_UNIVERSE + simpleUniverse++;
108:            }
109:
110:            public String getSimpleGeomName() {
111:                return SIMPLE_GEOM + simpleGeom++;
112:            }
113:
114:            public String getAlphaName() {
115:                return ALPHA + alpha++;
116:            }
117:
118:            public String getSoundName() {
119:                return SOUND + sound++;
120:            }
121:
122:            public String getKBInterpName() {
123:                return KB_ROT_POS_INTERP + kbInterp++;
124:            }
125:
126:            public String getFogName() {
127:                return FOG + fog++;
128:            }
129:
130:            public String getBackgroundName() {
131:                return BACKGROUND + background++;
132:            }
133:
134:            public String getName(javax.media.j3d.SceneGraphObject node) {
135:                if (node instanceof  KBRotPosScaleSplinePathInterpolator)
136:                    return getKBInterpName();
137:                else if (node instanceof  TransformGroup)
138:                    return getTransformGroupName();
139:                else if (node instanceof  Group)
140:                    return getGroupName();
141:                else if (node instanceof  AmbientLight)
142:                    return getLightName();
143:                else if (node instanceof  PointLight)
144:                    return getLightName();
145:                else if (node instanceof  SpotLight)
146:                    return getLightName();
147:                else if (node instanceof  DirectionalLight)
148:                    return getLightName();
149:                else if (node instanceof  Behavior)
150:                    return getBehaviorName();
151:                else if (node instanceof  Fog)
152:                    return getFogName();
153:                else if (node instanceof  Background)
154:                    return getBackgroundName();
155:                //	else if (node instanceof ESound) 
156:                //	    return getSoundName();
157:
158:                System.out.println("WARNING - no name for "
159:                        + node.getClass().getName());
160:                return "unknown" + unknown++;
161:            }
162:
163:            /**
164:             * Reset the names to their initial state
165:             */
166:            public void resetNames() {
167:                light = 0;
168:                group = 0;
169:                branchGroup = 0;
170:                transformGroup = 0;
171:                behavior = 0;
172:                interpolator = 0;
173:                objLoader = 0;
174:                simpleUniverse = 0;
175:                simpleGeom = 0;
176:                alpha = 0;
177:                sound = 0;
178:                kbInterp = 0;
179:            }
180:
181:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.