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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/experimental/J3dSkyPlugin.java,v 1.1 2005/04/20 21:04:27 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 Java 3D(tm) Fly Through.
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.j3dfly.experimental;
019:
020:        import javax.media.j3d.BranchGroup;
021:        import org.jdesktop.j3dfly.plugins.PluginPreference;
022:        import org.jdesktop.j3dfly.plugins.J3dFlyPlugin;
023:
024:        import org.jdesktop.j3dfly.utils.environment.J3dSkyControlPanel;
025:        import org.jdesktop.j3dfly.utils.environment.J3dSky;
026:        import org.jdesktop.j3dfly.J3dFlyContext;
027:
028:        /**
029:         *
030:         * @author  paulby
031:         * @version 
032:         */
033:        public class J3dSkyPlugin extends J3dFlyPlugin implements 
034:                java.awt.event.ActionListener {
035:
036:            private java.lang.ref.SoftReference panelReference = null;
037:            private J3dSky sky = null;
038:
039:            /** Creates new EnvironmentPlugin */
040:            public J3dSkyPlugin() {
041:                super ();
042:            }
043:
044:            /**
045:             * Returns the class of the plugin preference.
046:             *
047:             * Plugins that require more preference information should provide a
048:             * subclass of PluginPrefernece that contains all the extra preference
049:             * data. This class must be Serializable.
050:             */
051:            public Class getPluginPreferenceClass() {
052:                return J3dSkyPluginPreference.class;
053:            }
054:
055:            public void installPlugin(PluginPreference pluginToolPref,
056:                    J3dFlyContext j3dflyContext) {
057:                super .installPlugin(pluginToolPref, j3dflyContext);
058:                if (pluginPref.isInstallInMenu())
059:                    getMenu("Plugins").add(getMenuItem());
060:                sky = new J3dSky();
061:                sky.setEnable(pluginToolPref.isEnabled());
062:                sky.setCapability(BranchGroup.ALLOW_DETACH);
063:
064:                j3dflyContext.getUniverse().getLocale().addBranchGraph(sky);
065:            }
066:
067:            public void uninstallPlugin() {
068:                super .uninstallPlugin();
069:                if (pluginPref.isInstallInMenu())
070:                    getMenu("Plugins").remove(getMenuItem());
071:                j3dflyContext.getUniverse().getLocale().removeBranchGraph(sky);
072:            }
073:
074:            /**
075:             * Enable/disable the plugin
076:             */
077:            public void setEnabled(boolean enabled) {
078:                super .setEnabled(enabled);
079:                sky.setEnable(enabled);
080:            }
081:
082:            /**
083:             * Returns the control panel for this plugin
084:             */
085:            public javax.swing.JPanel getControlPanel() {
086:                if (panelReference == null || panelReference.get() == null)
087:                    panelReference = new java.lang.ref.SoftReference(
088:                            new J3dSkyControlPanel(sky));
089:
090:                return (J3dSkyControlPanel) panelReference.get();
091:            }
092:
093:            /**
094:             * Returns the Menu Item (or JMenu) which controls this
095:             * plugin. Null should be return for no menu entry
096:             */
097:            public javax.swing.JMenuItem getMenuItem() {
098:                if (menu == null) {
099:                    menu = new javax.swing.JMenuItem("Sky Controls...");
100:                    menu.addActionListener(this );
101:                }
102:
103:                return menu;
104:            }
105:
106:            /**
107:             * Get the title of the plugin
108:             */
109:            public String getPluginTitle() {
110:                return "J3dSky";
111:            }
112:
113:            public void actionPerformed(java.awt.event.ActionEvent p1) {
114:                showControls();
115:            }
116:
117:            public static class J3dSkyPluginPreference extends PluginPreference {
118:                public J3dSkyPluginPreference() {
119:                    super ();
120:                }
121:
122:                public J3dSkyPluginPreference(boolean enabled, boolean installed) {
123:                    super (enabled, installed);
124:                }
125:
126:                public J3dFlyPlugin instantiatePlugin() {
127:                    return new J3dSkyPlugin();
128:                }
129:
130:                /**
131:                 * Return a description of this plugin
132:                 */
133:                public String getDescription() {
134:                    return "Sample Sky simulator";
135:                }
136:
137:                /**
138:                 * Return the name of the Plugin for this prefernece.
139:                 * This is the name that will appear in the list of plugins
140:                 */
141:                public String getName() {
142:                    return "J3dSky";
143:                }
144:
145:            }
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.