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


001:        /*
002:         *  $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/utils/vpbehaviors/FlyControlDialog.java,v 1.1 2005/04/20 21:05:13 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.utils.vpbehaviors;
019:
020:        import org.jdesktop.j3dfly.utils.gui.FloatDocument;
021:
022:        /**
023:         *
024:         * @author  Paul Byrne
025:         * @version 1.5 01/18/02
026:         */
027:        public class FlyControlDialog extends javax.swing.JDialog {
028:
029:            private boolean userCancel = true; // Did user cancel dialog ?
030:
031:            /** Creates new form FlyControlDialog */
032:            public FlyControlDialog(java.awt.Frame parent, boolean modal) {
033:                super (parent, modal);
034:                initComponents();
035:                pack();
036:
037:                int x = parent.getWidth() / 2 - this .getWidth() / 2;
038:                int y = parent.getHeight() / 2 - this .getHeight() / 2;
039:
040:                setLocation(x, y);
041:            }
042:
043:            /** This method is called from within the constructor to
044:             * initialize the form.
045:             * WARNING: Do NOT modify this code. The content of this method is
046:             * always regenerated by the FormEditor.
047:             */
048:            private void initComponents() {//GEN-BEGIN:initComponents
049:                jPanel1 = new javax.swing.JPanel();
050:                jLabel1 = new javax.swing.JLabel();
051:                jLabel2 = new javax.swing.JLabel();
052:                stepTF = new javax.swing.JTextField();
053:                angleTF = new javax.swing.JTextField();
054:                jLabel3 = new javax.swing.JLabel();
055:                jLabel4 = new javax.swing.JLabel();
056:                jPanel2 = new javax.swing.JPanel();
057:                okB = new javax.swing.JButton();
058:                cancelB = new javax.swing.JButton();
059:                addWindowListener(new java.awt.event.WindowAdapter() {
060:                    public void windowClosing(java.awt.event.WindowEvent evt) {
061:                        closeDialog(evt);
062:                    }
063:                });
064:
065:                jPanel1.setLayout(new java.awt.GridBagLayout());
066:                java.awt.GridBagConstraints gridBagConstraints1;
067:
068:                jLabel1.setText("Step size");
069:                gridBagConstraints1 = new java.awt.GridBagConstraints();
070:                gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 4);
071:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST;
072:                jPanel1.add(jLabel1, gridBagConstraints1);
073:
074:                jLabel2.setText("Angle Size");
075:                gridBagConstraints1 = new java.awt.GridBagConstraints();
076:                gridBagConstraints1.gridx = 0;
077:                gridBagConstraints1.gridy = 1;
078:                gridBagConstraints1.insets = new java.awt.Insets(0, 0, 0, 4);
079:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.EAST;
080:                jPanel1.add(jLabel2, gridBagConstraints1);
081:
082:                stepTF.setPreferredSize(new java.awt.Dimension(60, 21));
083:                stepTF
084:                        .setToolTipText("The maximum distance view will move per frame when mouse pointer is at the window limit");
085:                stepTF.setText("jTextField1");
086:                stepTF.setMinimumSize(new java.awt.Dimension(60, 21));
087:                stepTF.setDocument(new FloatDocument());
088:                gridBagConstraints1 = new java.awt.GridBagConstraints();
089:                jPanel1.add(stepTF, gridBagConstraints1);
090:
091:                angleTF.setPreferredSize(new java.awt.Dimension(60, 21));
092:                angleTF
093:                        .setToolTipText("The maximum rotation angle the view will move per frame");
094:                angleTF.setText("jTextField2");
095:                angleTF.setMinimumSize(new java.awt.Dimension(60, 21));
096:                angleTF.setDocument(new FloatDocument());
097:                gridBagConstraints1 = new java.awt.GridBagConstraints();
098:                gridBagConstraints1.gridx = 1;
099:                gridBagConstraints1.gridy = 1;
100:                jPanel1.add(angleTF, gridBagConstraints1);
101:
102:                jLabel3.setText("m.");
103:                gridBagConstraints1 = new java.awt.GridBagConstraints();
104:                gridBagConstraints1.insets = new java.awt.Insets(0, 4, 0, 0);
105:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
106:                jPanel1.add(jLabel3, gridBagConstraints1);
107:
108:                jLabel4.setText("deg.");
109:                gridBagConstraints1 = new java.awt.GridBagConstraints();
110:                gridBagConstraints1.gridx = 2;
111:                gridBagConstraints1.gridy = 1;
112:                gridBagConstraints1.insets = new java.awt.Insets(0, 4, 0, 0);
113:                gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST;
114:                jPanel1.add(jLabel4, gridBagConstraints1);
115:
116:                getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
117:
118:                okB.setText("OK");
119:                okB.addActionListener(new java.awt.event.ActionListener() {
120:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
121:                        okBActionPerformed(evt);
122:                    }
123:                });
124:                jPanel2.add(okB);
125:
126:                cancelB.setText("Cancel");
127:                cancelB.addActionListener(new java.awt.event.ActionListener() {
128:                    public void actionPerformed(java.awt.event.ActionEvent evt) {
129:                        cancelBActionPerformed(evt);
130:                    }
131:                });
132:                jPanel2.add(cancelB);
133:
134:                getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
135:
136:            }//GEN-END:initComponents
137:
138:            private void cancelBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelBActionPerformed
139:            // Add your handling code here:
140:                setVisible(false);
141:                userCancel = true;
142:            }//GEN-LAST:event_cancelBActionPerformed
143:
144:            private void okBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okBActionPerformed
145:            // Add your handling code here:
146:                setVisible(false);
147:                userCancel = false;
148:            }//GEN-LAST:event_okBActionPerformed
149:
150:            /** Closes the dialog */
151:            private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
152:                setVisible(false);
153:                dispose();
154:                userCancel = true;
155:            }//GEN-LAST:event_closeDialog
156:
157:            /**
158:             * User cancelled dialog
159:             *
160:             * @return false if the OK button was pressed, false otherwise
161:             */
162:            public boolean userCancelled() {
163:                return userCancel;
164:            }
165:
166:            /**
167:             * Returns the angle from the dialog
168:             */
169:            public float getAngle() {
170:                try {
171:                    return Float.parseFloat(angleTF.getText());
172:                } catch (NumberFormatException e) {
173:                    e.printStackTrace();
174:                    return 3f;
175:                }
176:            }
177:
178:            public void setAngle(float angle) {
179:                angleTF.setText(Float.toString(angle));
180:            }
181:
182:            /**
183:             * Returns the step from the dialog
184:             */
185:            public float getStep() {
186:                try {
187:                    return Float.parseFloat(stepTF.getText());
188:                } catch (NumberFormatException e) {
189:                    e.printStackTrace();
190:                    return 10f;
191:                }
192:            }
193:
194:            public void setStep(float step) {
195:                stepTF.setText(Float.toString(step));
196:            }
197:
198:            // Variables declaration - do not modify//GEN-BEGIN:variables
199:            private javax.swing.JPanel jPanel1;
200:            private javax.swing.JLabel jLabel1;
201:            private javax.swing.JLabel jLabel2;
202:            private javax.swing.JTextField stepTF;
203:            private javax.swing.JTextField angleTF;
204:            private javax.swing.JLabel jLabel3;
205:            private javax.swing.JLabel jLabel4;
206:            private javax.swing.JPanel jPanel2;
207:            private javax.swing.JButton okB;
208:            private javax.swing.JButton cancelB;
209:            // End of variables declaration//GEN-END:variables
210:
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.