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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/plugins/DefaultLightingPanel.java,v 1.1 2005/04/20 21:04:38 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.plugins;
019:
020:        /**
021:         *
022:         * A simple lighting control panel.
023:         *
024:         * This really needs updating to allows users to changed the colors of
025:         * the lights and the position of the directional lights.
026:         *
027:         * @author  Paul Byrne
028:         * @version $Revision: 1.1 $
029:         */
030:        public class DefaultLightingPanel extends javax.swing.JPanel {
031:
032:            private DefaultLightingPlugin plugin;
033:
034:            /** Creates new form DefaultLightingPanel */
035:            public DefaultLightingPanel(DefaultLightingPlugin plugin) {
036:                super ();
037:                this .plugin = plugin;
038:                initComponents();
039:
040:                // TODO update this class so it does not assume ordering of
041:                // lights in the array
042:                if (plugin.getLights()[0] != null) {
043:                    this .setEnabled(plugin.getLights()[0].isLive());
044:                    ambientLightEnableCB.setSelected(plugin.getLights()[0]
045:                            .getEnable());
046:                    dirLight1EnableCB.setSelected(plugin.getLights()[1]
047:                            .getEnable());
048:                    dirLight2EnableCB.setSelected(plugin.getLights()[2]
049:                            .getEnable());
050:                } else
051:                    this .setEnabled(false);
052:            }
053:
054:            public void setEnabled(boolean enabled) {
055:                super .setEnabled(enabled);
056:                ambientLightEnableCB.setEnabled(enabled);
057:                dirLight1EnableCB.setEnabled(enabled);
058:                dirLight2EnableCB.setEnabled(enabled);
059:            }
060:
061:            /** This method is called from within the constructor to
062:             * initialize the form.
063:             * WARNING: Do NOT modify this code. The content of this method is
064:             * always regenerated by the FormEditor.
065:             */
066:            private void initComponents() {//GEN-BEGIN:initComponents
067:                java.awt.GridBagConstraints gridBagConstraints;
068:
069:                lightControlsPanel = new javax.swing.JPanel();
070:                ambientLightEnableCB = new javax.swing.JCheckBox();
071:                dirLight1EnableCB = new javax.swing.JCheckBox();
072:                dirLight2EnableCB = new javax.swing.JCheckBox();
073:                jPanel2 = new javax.swing.JPanel();
074:                askUserCB = new javax.swing.JCheckBox();
075:                jLabel1 = new javax.swing.JLabel();
076:                jLabel2 = new javax.swing.JLabel();
077:
078:                setLayout(new java.awt.GridBagLayout());
079:
080:                setEnabled(false);
081:                lightControlsPanel.setLayout(new java.awt.GridBagLayout());
082:
083:                lightControlsPanel
084:                        .setBorder(new javax.swing.border.EtchedBorder());
085:                ambientLightEnableCB.setSelected(true);
086:                ambientLightEnableCB.setText("AmbientLight");
087:                ambientLightEnableCB
088:                        .addActionListener(new java.awt.event.ActionListener() {
089:                            public void actionPerformed(
090:                                    java.awt.event.ActionEvent evt) {
091:                                ambientLightEnableCBActionPerformed(evt);
092:                            }
093:                        });
094:
095:                gridBagConstraints = new java.awt.GridBagConstraints();
096:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
097:                gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
098:                lightControlsPanel
099:                        .add(ambientLightEnableCB, gridBagConstraints);
100:
101:                dirLight1EnableCB.setSelected(true);
102:                dirLight1EnableCB.setText("Directional Light 1");
103:                dirLight1EnableCB
104:                        .addActionListener(new java.awt.event.ActionListener() {
105:                            public void actionPerformed(
106:                                    java.awt.event.ActionEvent evt) {
107:                                dirLight1EnableCBActionPerformed(evt);
108:                            }
109:                        });
110:
111:                gridBagConstraints = new java.awt.GridBagConstraints();
112:                gridBagConstraints.gridx = 0;
113:                gridBagConstraints.gridy = 1;
114:                gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
115:                lightControlsPanel.add(dirLight1EnableCB, gridBagConstraints);
116:
117:                dirLight2EnableCB.setSelected(true);
118:                dirLight2EnableCB.setText("Directional Light 2");
119:                dirLight2EnableCB
120:                        .addActionListener(new java.awt.event.ActionListener() {
121:                            public void actionPerformed(
122:                                    java.awt.event.ActionEvent evt) {
123:                                dirLight2EnableCBActionPerformed(evt);
124:                            }
125:                        });
126:
127:                gridBagConstraints = new java.awt.GridBagConstraints();
128:                gridBagConstraints.gridx = 0;
129:                gridBagConstraints.gridy = 2;
130:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
131:                gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
132:                lightControlsPanel.add(dirLight2EnableCB, gridBagConstraints);
133:
134:                gridBagConstraints = new java.awt.GridBagConstraints();
135:                gridBagConstraints.gridx = 0;
136:                gridBagConstraints.gridy = 1;
137:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
138:                add(lightControlsPanel, gridBagConstraints);
139:
140:                askUserCB.setText("Ask User");
141:                askUserCB
142:                        .setToolTipText("Ask the User before adding the default lights");
143:                askUserCB
144:                        .addActionListener(new java.awt.event.ActionListener() {
145:                            public void actionPerformed(
146:                                    java.awt.event.ActionEvent evt) {
147:                                askUserCBActionPerformed(evt);
148:                            }
149:                        });
150:
151:                jPanel2.add(askUserCB);
152:
153:                gridBagConstraints = new java.awt.GridBagConstraints();
154:                gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
155:                add(jPanel2, gridBagConstraints);
156:
157:                jLabel1.setText("This is a place holder for a");
158:                gridBagConstraints = new java.awt.GridBagConstraints();
159:                gridBagConstraints.gridx = 0;
160:                gridBagConstraints.gridy = 2;
161:                gridBagConstraints.insets = new java.awt.Insets(30, 0, 0, 0);
162:                add(jLabel1, gridBagConstraints);
163:
164:                jLabel2.setText("a fully featured light editor");
165:                gridBagConstraints = new java.awt.GridBagConstraints();
166:                gridBagConstraints.gridx = 0;
167:                gridBagConstraints.gridy = 3;
168:                add(jLabel2, gridBagConstraints);
169:
170:            }//GEN-END:initComponents
171:
172:            private void askUserCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_askUserCBActionPerformed
173:                // Add your handling code here:
174:                plugin.setAskUser(askUserCB.isSelected());
175:            }//GEN-LAST:event_askUserCBActionPerformed
176:
177:            private void ambientLightEnableCBActionPerformed(
178:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ambientLightEnableCBActionPerformed
179:                // Add your handling code here:
180:                plugin.getLights()[0].setEnable(ambientLightEnableCB
181:                        .isSelected());
182:            }//GEN-LAST:event_ambientLightEnableCBActionPerformed
183:
184:            private void dirLight1EnableCBActionPerformed(
185:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dirLight1EnableCBActionPerformed
186:                // Add your handling code here:
187:                plugin.getLights()[1].setEnable(dirLight1EnableCB.isSelected());
188:            }//GEN-LAST:event_dirLight1EnableCBActionPerformed
189:
190:            private void dirLight2EnableCBActionPerformed(
191:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dirLight2EnableCBActionPerformed
192:                // Add your handling code here:
193:                plugin.getLights()[2].setEnable(dirLight2EnableCB.isSelected());
194:            }//GEN-LAST:event_dirLight2EnableCBActionPerformed
195:
196:            // Variables declaration - do not modify//GEN-BEGIN:variables
197:            private javax.swing.JPanel jPanel2;
198:            private javax.swing.JPanel lightControlsPanel;
199:            private javax.swing.JCheckBox ambientLightEnableCB;
200:            private javax.swing.JCheckBox dirLight2EnableCB;
201:            private javax.swing.JCheckBox dirLight1EnableCB;
202:            private javax.swing.JLabel jLabel2;
203:            private javax.swing.JLabel jLabel1;
204:            private javax.swing.JCheckBox askUserCB;
205:            // End of variables declaration//GEN-END:variables
206:
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.