Source Code Cross Referenced for CreateWarpDialog.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/CreateWarpDialog.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.JDialog;
021:
022:        /**
023:         * Dialog box for creating new warp objects
024:         *
025:         * @author Paul Byrne
026:         * @version	1.5, 01/18/02
027:         */
028:        public class CreateWarpDialog extends javax.swing.JDialog {
029:
030:            private WarpSet warpSet;
031:            private boolean isValid; // Do we have a valid warp name
032:            private JDialog parent;
033:
034:            /** Creates new form CreateWarpDialog */
035:            public CreateWarpDialog(JDialog parent, boolean modal,
036:                    WarpSet warpSet) {
037:                super (parent, modal);
038:                this .parent = parent;
039:                this .warpSet = warpSet;
040:                isValid = false;
041:                initComponents();
042:                pack();
043:                centerOnParent();
044:            }
045:
046:            /** This method is called from within the constructor to
047:             * initialize the form.
048:             * WARNING: Do NOT modify this code. The content of this method is
049:             * always regenerated by the FormEditor.
050:             */
051:            private void initComponents() {//GEN-BEGIN:initComponents
052:                jPanel1 = new javax.swing.JPanel();
053:                duplicateLabel = new javax.swing.JLabel();
054:                jLabel2 = new javax.swing.JLabel();
055:                jLabel3 = new javax.swing.JLabel();
056:                nameTF = new javax.swing.JTextField();
057:                jScrollPane1 = new javax.swing.JScrollPane();
058:                descriptionTF = new javax.swing.JTextField();
059:                jPanel2 = new javax.swing.JPanel();
060:                okB = new javax.swing.JButton();
061:                cancelB = new javax.swing.JButton();
062:                setModal(true);
063:                setTitle("Create Warp");
064:                addWindowListener(new java.awt.event.WindowAdapter() {
065:                    public void windowClosing(java.awt.event.WindowEvent evt) {
066:                        closeDialog(evt);
067:                    }
068:                });
069:
070:                jPanel1.setLayout(new java.awt.GridBagLayout());
071:                java.awt.GridBagConstraints gridBagConstraints1;
072:
073:                duplicateLabel.setFont(new java.awt.Font("Dialog", 1, 11));
074:                gridBagConstraints1 = new java.awt.GridBagConstraints();
075:                jPanel1.add(duplicateLabel, gridBagConstraints1);
076:
077:                jLabel2.setText("Name");
078:                gridBagConstraints1 = new java.awt.GridBagConstraints();
079:                gridBagConstraints1.gridx = 0;
080:                gridBagConstraints1.gridy = 1;
081:                gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 4);
082:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST;
083:                jPanel1.add(jLabel2, gridBagConstraints1);
084:
085:                jLabel3.setText("Description");
086:                gridBagConstraints1 = new java.awt.GridBagConstraints();
087:                gridBagConstraints1.gridx = 0;
088:                gridBagConstraints1.gridy = 2;
089:                gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 4);
090:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST;
091:                jPanel1.add(jLabel3, gridBagConstraints1);
092:
093:                nameTF.setPreferredSize(new java.awt.Dimension(100, 21));
094:                nameTF.setToolTipText("Name for the warp");
095:                nameTF.setMinimumSize(new java.awt.Dimension(100, 21));
096:                gridBagConstraints1 = new java.awt.GridBagConstraints();
097:                gridBagConstraints1.gridx = 1;
098:                gridBagConstraints1.gridy = 1;
099:                jPanel1.add(nameTF, gridBagConstraints1);
100:
101:                jScrollPane1.setMinimumSize(new java.awt.Dimension(22, 39));
102:
103:                descriptionTF
104:                        .setToolTipText("Optional description of the warp");
105:                jScrollPane1.setViewportView(descriptionTF);
106:
107:                gridBagConstraints1 = new java.awt.GridBagConstraints();
108:                gridBagConstraints1.gridx = 1;
109:                gridBagConstraints1.gridy = 2;
110:                gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
111:                jPanel1.add(jScrollPane1, gridBagConstraints1);
112:
113:                getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
114:
115:                okB.setText("OK");
116:                okB.addActionListener(new java.awt.event.ActionListener() {
117:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
118:                        okBActionPerformed(evt);
119:                    }
120:                });
121:                jPanel2.add(okB);
122:
123:                cancelB.setText("Cancel");
124:                cancelB.addActionListener(new java.awt.event.ActionListener() {
125:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
126:                        cancelBActionPerformed(evt);
127:                    }
128:                });
129:                jPanel2.add(cancelB);
130:
131:                getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
132:
133:            }//GEN-END:initComponents
134:
135:            private void cancelBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBActionPerformed
136:            // Add your handling code here:
137:                isValid = false;
138:                setVisible(false);
139:            }//GEN-LAST:event_cancelBActionPerformed
140:
141:            private void okBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBActionPerformed
142:            // Add your handling code here:
143:                if (warpSet.nameExists(nameTF.getText())) {
144:                    duplicateLabel.setText("Warp Name is not unique");
145:                    pack();
146:                } else {
147:                    isValid = true;
148:                    setVisible(false);
149:                }
150:            }//GEN-LAST:event_okBActionPerformed
151:
152:            /** Closes the dialog */
153:            private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
154:                setVisible(false);
155:                dispose();
156:            }//GEN-LAST:event_closeDialog
157:
158:            /**
159:             * Return true if the user has entered a valid warp name and
160:             * pressed OK
161:             */
162:            public boolean isValid() {
163:                return isValid;
164:            }
165:
166:            public String getName() {
167:                return nameTF.getText();
168:            }
169:
170:            public String getDescription() {
171:                return descriptionTF.getText();
172:            }
173:
174:            private void centerOnParent() {
175:                int parentW = parent.getWidth();
176:                int parentH = parent.getHeight();
177:
178:                setLocation(parentW / 2 - getWidth() / 2, parentH / 2
179:                        - getHeight() / 2);
180:            }
181:
182:            // Variables declaration - do not modify//GEN-BEGIN:variables
183:            private javax.swing.JPanel jPanel1;
184:            private javax.swing.JLabel duplicateLabel;
185:            private javax.swing.JLabel jLabel2;
186:            private javax.swing.JLabel jLabel3;
187:            private javax.swing.JTextField nameTF;
188:            private javax.swing.JScrollPane jScrollPane1;
189:            private javax.swing.JTextField descriptionTF;
190:            private javax.swing.JPanel jPanel2;
191:            private javax.swing.JButton okB;
192:            private javax.swing.JButton cancelB;
193:            // End of variables declaration//GEN-END:variables
194:
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.