001: /*
002: * $Header: /cvs/j3dfly/J3dFly/src/org/jdesktop/j3dfly/plugins/J3dFlyMouseBehaviorControlPanel.java,v 1.1 2005/04/20 21:04:40 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: * @author Paul Byrne
023: * @version $Revision: 1.1 $
024: */
025: public class J3dFlyMouseBehaviorControlPanel extends javax.swing.JPanel {
026:
027: private J3dFlyMouseBehaviorPluginPreference pluginPref;
028:
029: /** Creates new form J3dFlyMouseBehaviorControlPanel */
030: public J3dFlyMouseBehaviorControlPanel(
031: J3dFlyMouseBehaviorPluginPreference pluginPref) {
032: this .pluginPref = pluginPref;
033: initComponents();
034: }
035:
036: /** This method is called from within the constructor to
037: * initialize the form.
038: * WARNING: Do NOT modify this code. The content of this method is
039: * always regenerated by the Form Editor.
040: */
041: private void initComponents() {//GEN-BEGIN:initComponents
042: java.awt.GridBagConstraints gridBagConstraints;
043:
044: jLabel1 = new javax.swing.JLabel();
045: jLabel2 = new javax.swing.JLabel();
046: jLabel3 = new javax.swing.JLabel();
047: jLabel4 = new javax.swing.JLabel();
048: angleTF = new javax.swing.JTextField();
049: forwardTF = new javax.swing.JTextField();
050:
051: setLayout(new java.awt.GridBagLayout());
052:
053: jLabel1.setText("Angle Step");
054: jLabel1.setToolTipText("The maximum angle change per frame");
055: gridBagConstraints = new java.awt.GridBagConstraints();
056: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
057: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
058: add(jLabel1, gridBagConstraints);
059:
060: jLabel2.setText("Forward Step");
061: jLabel2.setToolTipText("The maximum forward step per frame");
062: gridBagConstraints = new java.awt.GridBagConstraints();
063: gridBagConstraints.gridx = 0;
064: gridBagConstraints.gridy = 1;
065: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
066: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
067: add(jLabel2, gridBagConstraints);
068:
069: jLabel3.setText("meters");
070: gridBagConstraints = new java.awt.GridBagConstraints();
071: gridBagConstraints.gridx = 2;
072: gridBagConstraints.gridy = 1;
073: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
074: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
075: add(jLabel3, gridBagConstraints);
076:
077: jLabel4.setText("degrees");
078: gridBagConstraints = new java.awt.GridBagConstraints();
079: gridBagConstraints.gridx = 2;
080: gridBagConstraints.gridy = 0;
081: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
082: gridBagConstraints.insets = new java.awt.Insets(0, 4, 0, 0);
083: add(jLabel4, gridBagConstraints);
084:
085: angleTF.setColumns(7);
086: angleTF
087: .setDocument(new org.jdesktop.j3dfly.utils.gui.FloatDocument());
088: angleTF.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
089: angleTF.setText("3");
090: angleTF.setToolTipText("The maximum angle change per frame");
091: angleTF.addActionListener(new java.awt.event.ActionListener() {
092: public void actionPerformed(java.awt.event.ActionEvent evt) {
093: angleTFActionPerformed(evt);
094: }
095: });
096:
097: angleTF.addFocusListener(new java.awt.event.FocusAdapter() {
098: public void focusLost(java.awt.event.FocusEvent evt) {
099: angleTFFocusLost(evt);
100: }
101: });
102:
103: gridBagConstraints = new java.awt.GridBagConstraints();
104: gridBagConstraints.gridx = 1;
105: gridBagConstraints.gridy = 0;
106: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
107: add(angleTF, gridBagConstraints);
108:
109: forwardTF.setColumns(7);
110: forwardTF
111: .setDocument(new org.jdesktop.j3dfly.utils.gui.FloatDocument());
112:
113: forwardTF.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
114: forwardTF.setText("10");
115: forwardTF.setToolTipText("The maximum forward step per frame");
116: forwardTF
117: .addActionListener(new java.awt.event.ActionListener() {
118: public void actionPerformed(
119: java.awt.event.ActionEvent evt) {
120: forwardTFActionPerformed(evt);
121: }
122: });
123:
124: forwardTF.addFocusListener(new java.awt.event.FocusAdapter() {
125: public void focusLost(java.awt.event.FocusEvent evt) {
126: forwardTFFocusLost(evt);
127: }
128: });
129:
130: gridBagConstraints = new java.awt.GridBagConstraints();
131: gridBagConstraints.gridx = 1;
132: gridBagConstraints.gridy = 1;
133: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
134: add(forwardTF, gridBagConstraints);
135:
136: }//GEN-END:initComponents
137:
138: private void forwardTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_forwardTFActionPerformed
139: // Add your handling code here:
140: pluginPref.setForwardStep((float) Math.toRadians(Float
141: .parseFloat(forwardTF.getText())));
142: }//GEN-LAST:event_forwardTFActionPerformed
143:
144: private void forwardTFFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_forwardTFFocusLost
145: // Add your handling code here:
146: pluginPref.setForwardStep((float) Math.toRadians(Float
147: .parseFloat(forwardTF.getText())));
148: }//GEN-LAST:event_forwardTFFocusLost
149:
150: private void angleTFFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_angleTFFocusLost
151: // Add your handling code here:
152: pluginPref.setAngleStep((float) Math.toRadians(Float
153: .parseFloat(angleTF.getText())));
154: }//GEN-LAST:event_angleTFFocusLost
155:
156: private void angleTFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_angleTFActionPerformed
157: // Add your handling code here:
158: pluginPref.setAngleStep((float) Math.toRadians(Float
159: .parseFloat(angleTF.getText())));
160: }//GEN-LAST:event_angleTFActionPerformed
161:
162: // Variables declaration - do not modify//GEN-BEGIN:variables
163: private javax.swing.JTextField forwardTF;
164: private javax.swing.JLabel jLabel4;
165: private javax.swing.JLabel jLabel3;
166: private javax.swing.JLabel jLabel2;
167: private javax.swing.JLabel jLabel1;
168: private javax.swing.JTextField angleTF;
169: // End of variables declaration//GEN-END:variables
170:
171: }
|