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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/warp/WarpEditorDialog.java,v 1.1 2005/04/20 21:05:19 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.warp;
019:
020:        import javax.swing.DefaultListModel;
021:        import javax.swing.event.ListSelectionListener;
022:        import javax.media.j3d.TransformGroup;
023:        import javax.media.j3d.Transform3D;
024:
025:        /**
026:         * Dialog box for editing Warps
027:         *
028:         * @author Paul Byrne
029:         * @version	1.6, 01/18/02
030:         */
031:        public class WarpEditorDialog extends javax.swing.JDialog implements 
032:                ListSelectionListener {
033:
034:            private WarpSet warpSet;
035:            private TransformGroup viewTG;
036:            private DefaultListModel listModel;
037:
038:            /** Creates new form WarpEditorDialog */
039:            public WarpEditorDialog(java.awt.Frame parent, boolean modal,
040:                    WarpSet warpSet, TransformGroup viewTG) {
041:                super (parent, modal);
042:                this .warpSet = warpSet;
043:                this .viewTG = viewTG;
044:                listModel = new DefaultListModel();
045:                String[] warpName = warpSet.getNames();
046:                for (int i = 0; i < warpName.length; i++)
047:                    listModel.addElement(warpName[i]);
048:                initComponents();
049:                pack();
050:
051:                warpList.addListSelectionListener(this );
052:
053:                int x = parent.getWidth() / 2 - this .getWidth() / 2;
054:                int y = parent.getHeight() / 2 - this .getHeight() / 2;
055:
056:                setLocation(x, y);
057:            }
058:
059:            /** This method is called from within the constructor to
060:             * initialize the form.
061:             * WARNING: Do NOT modify this code. The content of this method is
062:             * always regenerated by the FormEditor.
063:             */
064:            private void initComponents() {//GEN-BEGIN:initComponents
065:                jPanel1 = new javax.swing.JPanel();
066:                createWarpB = new javax.swing.JButton();
067:                deleteWarpB = new javax.swing.JButton();
068:                makeDefaultB = new javax.swing.JButton();
069:                jScrollPane1 = new javax.swing.JScrollPane();
070:                warpList = new javax.swing.JList();
071:                jPanel2 = new javax.swing.JPanel();
072:                okB = new javax.swing.JButton();
073:                addWindowListener(new java.awt.event.WindowAdapter() {
074:                    public void windowClosing(java.awt.event.WindowEvent evt) {
075:                        closeDialog(evt);
076:                    }
077:                });
078:
079:                jPanel1.setLayout(new java.awt.GridBagLayout());
080:                java.awt.GridBagConstraints gridBagConstraints1;
081:
082:                createWarpB
083:                        .setToolTipText("Create a Warp for the current View");
084:                createWarpB.setLabel("Create Warp");
085:                createWarpB
086:                        .addActionListener(new java.awt.event.ActionListener() {
087:                            public void actionPerformed(
088:                                    java.awt.event.ActionEvent evt) {
089:                                createWarpBActionPerformed(evt);
090:                            }
091:                        });
092:                gridBagConstraints1 = new java.awt.GridBagConstraints();
093:                gridBagConstraints1.gridx = 0;
094:                gridBagConstraints1.gridy = 1;
095:                jPanel1.add(createWarpB, gridBagConstraints1);
096:
097:                deleteWarpB.setToolTipText("Delete the selected Warp");
098:                deleteWarpB.setText("Delete");
099:                deleteWarpB.setEnabled(false);
100:                deleteWarpB
101:                        .addActionListener(new java.awt.event.ActionListener() {
102:                            public void actionPerformed(
103:                                    java.awt.event.ActionEvent evt) {
104:                                deleteWarpBActionPerformed(evt);
105:                            }
106:                        });
107:                gridBagConstraints1 = new java.awt.GridBagConstraints();
108:                gridBagConstraints1.gridx = 1;
109:                gridBagConstraints1.gridy = 1;
110:                jPanel1.add(deleteWarpB, gridBagConstraints1);
111:
112:                makeDefaultB
113:                        .setToolTipText("Make the selected warp the default (initial) warp for this file");
114:                makeDefaultB.setText("Make Default");
115:                makeDefaultB.setEnabled(false);
116:                makeDefaultB
117:                        .addActionListener(new java.awt.event.ActionListener() {
118:                            public void actionPerformed(
119:                                    java.awt.event.ActionEvent evt) {
120:                                makeDefaultBActionPerformed(evt);
121:                            }
122:                        });
123:                gridBagConstraints1 = new java.awt.GridBagConstraints();
124:                gridBagConstraints1.gridx = 2;
125:                gridBagConstraints1.gridy = 1;
126:                jPanel1.add(makeDefaultB, gridBagConstraints1);
127:
128:                jScrollPane1.setMinimumSize(new java.awt.Dimension(250, 100));
129:
130:                warpList.setPreferredSize(new java.awt.Dimension(250, 100));
131:                warpList.setModel(listModel);
132:                warpList
133:                        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
134:                jScrollPane1.setViewportView(warpList);
135:
136:                gridBagConstraints1 = new java.awt.GridBagConstraints();
137:                gridBagConstraints1.gridwidth = 3;
138:                jPanel1.add(jScrollPane1, gridBagConstraints1);
139:
140:                getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
141:
142:                okB.setText("OK");
143:                okB.addActionListener(new java.awt.event.ActionListener() {
144:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
145:                        okBActionPerformed(evt);
146:                    }
147:                });
148:                jPanel2.add(okB);
149:
150:                getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
151:
152:            }//GEN-END:initComponents
153:
154:            private void okBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBActionPerformed
155:            // Add your handling code here:
156:                setVisible(false);
157:            }//GEN-LAST:event_okBActionPerformed
158:
159:            private void makeDefaultBActionPerformed(
160:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_makeDefaultBActionPerformed
161:            // Add your handling code here:
162:                warpSet.setDefaultWarp((String) warpList.getSelectedValue());
163:            }//GEN-LAST:event_makeDefaultBActionPerformed
164:
165:            private void deleteWarpBActionPerformed(
166:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteWarpBActionPerformed
167:            // Add your handling code here:
168:                warpSet
169:                        .deleteWarpPosition((String) warpList
170:                                .getSelectedValue());
171:                listModel.removeElement(warpList.getSelectedValue());
172:            }//GEN-LAST:event_deleteWarpBActionPerformed
173:
174:            private void createWarpBActionPerformed(
175:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createWarpBActionPerformed
176:            // Add your handling code here:
177:                Transform3D trans = new Transform3D();
178:                viewTG.getTransform(trans);
179:
180:                String name = warpSet.createWarp(trans, this );
181:
182:                listModel.addElement(name);
183:
184:            }//GEN-LAST:event_createWarpBActionPerformed
185:
186:            /** Closes the dialog */
187:            private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
188:                setVisible(false);
189:                viewTG = null;
190:                dispose();
191:            }//GEN-LAST:event_closeDialog
192:
193:            /**
194:             * List Selection Listener
195:             */
196:            public void valueChanged(
197:                    final javax.swing.event.ListSelectionEvent p1) {
198:                makeDefaultB.setEnabled(true);
199:                deleteWarpB.setEnabled(true);
200:            }
201:
202:            // Variables declaration - do not modify//GEN-BEGIN:variables
203:            private javax.swing.JPanel jPanel1;
204:            private javax.swing.JButton createWarpB;
205:            private javax.swing.JButton deleteWarpB;
206:            private javax.swing.JButton makeDefaultB;
207:            private javax.swing.JScrollPane jScrollPane1;
208:            private javax.swing.JList warpList;
209:            private javax.swing.JPanel jPanel2;
210:            private javax.swing.JButton okB;
211:            // End of variables declaration//GEN-END:variables
212:
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.