01: /*
02: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/locationeditor/PointScaleFrame.java,v 1.1 2005/04/20 22:20:35 paulby Exp $
03: *
04: * Sun Public License Notice
05: *
06: * The contents of this file are subject to the Sun Public License Version
07: * 1.0 (the "License"). You may not use this file except in compliance with
08: * the License. A copy of the License is available at http://www.sun.com/
09: *
10: * The Original Code is the Java 3D(tm) Scene Graph Editor.
11: * The Initial Developer of the Original Code is Paul Byrne.
12: * Portions created by Paul Byrne are Copyright (C) 2002.
13: * All Rights Reserved.
14: *
15: * Contributor(s): Paul Byrne.
16: *
17: **/
18: package org.jdesktop.j3dedit.locationeditor;
19:
20: import javax.swing.JSlider;
21: import org.jdesktop.j3dedit.scenegrapheditor.visualtools.PointHighlightControl;
22: import org.jdesktop.j3dfly.event.EventProcessor;
23:
24: /**
25: *
26: * @author paulby
27: */
28: public class PointScaleFrame extends javax.swing.JFrame {
29:
30: private EventProcessor eventProcessor;
31:
32: /** Creates new form PointScaleFrame */
33: public PointScaleFrame(EventProcessor eventProcessor) {
34: this .eventProcessor = eventProcessor;
35: initComponents();
36: }
37:
38: /** This method is called from within the constructor to
39: * initialize the form.
40: * WARNING: Do NOT modify this code. The content of this method is
41: * always regenerated by the Form Editor.
42: */
43: private void initComponents() {//GEN-BEGIN:initComponents
44: doubleB = new javax.swing.JButton();
45: halveB = new javax.swing.JButton();
46:
47: getContentPane().setLayout(new java.awt.GridLayout(0, 1));
48:
49: addWindowListener(new java.awt.event.WindowAdapter() {
50: public void windowClosing(java.awt.event.WindowEvent evt) {
51: exitForm(evt);
52: }
53: });
54:
55: doubleB.setText("*2");
56: doubleB.addActionListener(new java.awt.event.ActionListener() {
57: public void actionPerformed(java.awt.event.ActionEvent evt) {
58: doubleBActionPerformed(evt);
59: }
60: });
61:
62: getContentPane().add(doubleB);
63:
64: halveB.setText(" 1/2");
65: halveB.addActionListener(new java.awt.event.ActionListener() {
66: public void actionPerformed(java.awt.event.ActionEvent evt) {
67: halveBActionPerformed(evt);
68: }
69: });
70:
71: getContentPane().add(halveB);
72:
73: pack();
74: }//GEN-END:initComponents
75:
76: private void doubleBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doubleBActionPerformed
77: // Add your handling code here:
78: eventProcessor.postEvent(PointHighlightControl
79: .newPointScaleEvent(2f));
80: }//GEN-LAST:event_doubleBActionPerformed
81:
82: private void halveBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_halveBActionPerformed
83: // Add your handling code here:
84: eventProcessor.postEvent(PointHighlightControl
85: .newPointScaleEvent(0.5f));
86: }//GEN-LAST:event_halveBActionPerformed
87:
88: /** Exit the Application */
89: private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
90: System.exit(0);
91: }//GEN-LAST:event_exitForm
92:
93: // Variables declaration - do not modify//GEN-BEGIN:variables
94: private javax.swing.JButton doubleB;
95: private javax.swing.JButton halveB;
96: // End of variables declaration//GEN-END:variables
97:
98: }
|