Source Code Cross Referenced for Interpolator.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: Interpolator.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:25 $
029:         * $State: Exp $
030:         */
031:
032:        package javax.media.j3d;
033:
034:        import java.util.Vector;
035:
036:        /**
037:         * Interpolator is an abstract class that extends Behavior to provide
038:         * common methods used by various interpolation subclasses.  These
039:         * include methods to convert a time value into an alpha value (A
040:         * value in the range 0 to 1) and a method to initialize the behavior.
041:         * Subclasses provide the methods that convert alpha values into
042:         * values within that subclass' output range.
043:         */
044:
045:        public abstract class Interpolator extends Behavior {
046:
047:            // This interpolator's alpha generator
048:            Alpha alpha;
049:
050:            /** 
051:             * Default WakeupCondition for all interpolators. The
052:             * wakeupOn method of Behavior, which takes a WakeupCondition as
053:             * the method parameter, will need to be called at the end
054:             * of the processStimulus method of any class that subclasses
055:             * Interpolator; this can be done with the following method call: 
056:             * wakeupOn(defaultWakeupCriterion).
057:             */
058:            protected WakeupCriterion defaultWakeupCriterion = (WakeupCriterion) new WakeupOnElapsedFrames(
059:                    0);
060:
061:            /**
062:             * Constructs an Interpolator node with a null alpha value.
063:             */
064:            public Interpolator() {
065:            }
066:
067:            /**
068:             * Constructs an Interpolator node with the specified alpha value.
069:             * @param alpha the alpha object used by this interpolator.
070:             * If it is null, then this interpolator will not run.
071:             */
072:            public Interpolator(Alpha alpha) {
073:                this .alpha = alpha;
074:            }
075:
076:            /**
077:             * Retrieves this interpolator's alpha object.
078:             * @return this interpolator's alpha object
079:             */
080:            public Alpha getAlpha() {
081:                return this .alpha;
082:            }
083:
084:            /**
085:             * Set this interpolator's alpha to the specified alpha object.
086:             * @param alpha the new alpha object.  If set to null,
087:             * then this interpolator will stop running.
088:             */
089:            public void setAlpha(Alpha alpha) {
090:                this .alpha = alpha;
091:                VirtualUniverse.mc.sendRunMessage(J3dThread.RENDER_THREAD);
092:            }
093:
094:            /**
095:             * This is the default Interpolator behavior initialization routine.
096:             * It schedules the behavior to awaken at the next frame.
097:             */
098:            public void initialize() {
099:                // Reset alpha
100:                //alpha.setStartTime(J3dClock.currentTimeMillis());
101:
102:                // Insert wakeup condition into queue
103:                wakeupOn(defaultWakeupCriterion);
104:            }
105:
106:            /**
107:             * Copies all Interpolator information from
108:             * <code>originalNode</code> into
109:             * the current node.  This method is called from the
110:             * <code>cloneNode</code> method which is, in turn, called by the
111:             * <code>cloneTree</code> method.<P> 
112:             *
113:             * @param originalNode the original node to duplicate.
114:             * @param forceDuplicate when set to <code>true</code>, causes the
115:             *  <code>duplicateOnCloneTree</code> flag to be ignored.  When
116:             *  <code>false</code>, the value of each node's
117:             *  <code>duplicateOnCloneTree</code> variable determines whether
118:             *  NodeComponent data is duplicated or copied.
119:             *
120:             * @exception RestrictedAccessException if this object is part of a live
121:             *  or compiled scenegraph.
122:             *
123:             * @see Node#duplicateNode
124:             * @see Node#cloneTree
125:             * @see NodeComponent#setDuplicateOnCloneTree
126:             */
127:            void duplicateAttributes(Node originalNode, boolean forceDuplicate) {
128:                super .duplicateAttributes(originalNode, forceDuplicate);
129:
130:                Interpolator it = (Interpolator) originalNode;
131:
132:                Alpha a = it.getAlpha();
133:                if (a != null) {
134:                    setAlpha(a.cloneAlpha());
135:                }
136:            }
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.