/Users/lyon/j4p/src/sound/filterDesign/EditRootFrame.java

1    package sound.filterDesign; 
2     
3    // Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov. 
4    // Jad home page: http://www.geocities.com/kpdus/jad.html 
5    // Decompiler options: packimports(3)  
6    // Source File Name:   EditRootFrame.java 
7     
8    import java.awt.*; 
9    import java.awt.event.ActionEvent; 
10   import java.awt.event.ActionListener; 
11   import java.awt.event.WindowAdapter; 
12   import java.awt.event.WindowEvent; 
13    
14   public class EditRootFrame extends Frame 
15           implements ActionListener { 
16    
17       public EditRootFrame(SPlaneBean splanebean) { 
18           super("Edit Pole/Zero"); 
19           setSize(300, 150); 
20           setVisible(false); 
21           source = splanebean; 
22           setLayout(new GridBagLayout()); 
23           GridBagConstraints gridbagconstraints = new GridBagConstraints(); 
24           Real = new Label("Real : ", 2); 
25           Imag = new Label("Imag : ", 2); 
26           realTxt = new TextField(8); 
27           imagTxt = new TextField(8); 
28           okButton = new Button("Ok"); 
29           cancelButton = new Button("Cancel"); 
30           Panel panel = new Panel(); 
31           panel.add(Real); 
32           panel.add(realTxt); 
33           panel.add(Imag); 
34           panel.add(imagTxt); 
35           gridbagconstraints.gridy = 0; 
36           add(panel, gridbagconstraints); 
37           panel = new Panel(); 
38           panel.add(okButton); 
39           panel.add(cancelButton); 
40           gridbagconstraints.gridy = 1; 
41           add(panel, gridbagconstraints); 
42           validate(); 
43           okButton.addActionListener(this); 
44           cancelButton.addActionListener(this); 
45           realTxt.addActionListener(this); 
46           imagTxt.addActionListener(this); 
47           addWindowListener(new WindowAdapter() { 
48    
49               public void windowClosing(WindowEvent windowevent) { 
50                   setVisible(false); 
51               } 
52    
53           }); 
54       } 
55    
56       public void wake(int i, boolean flag, Root root) { 
57           isZero = flag; 
58           rootnumber = i; 
59           realTxt.setText(String.valueOf(root.getReal())); 
60           imagTxt.setText(String.valueOf(root.getImag())); 
61           setVisible(true); 
62       } 
63    
64       public void actionPerformed(ActionEvent actionevent) { 
65           Object obj = actionevent.getSource(); 
66           if (obj == cancelButton) { 
67               setVisible(false); 
68               return; 
69           } 
70           try { 
71               real = (new Double(realTxt.getText())).doubleValue(); 
72               imag = (new Double(imagTxt.getText())).doubleValue(); 
73               source.changeRoot(rootnumber, isZero, real, imag); 
74               setVisible(false); 
75               return; 
76           } catch (NumberFormatException _ex) { 
77               return; 
78           } 
79       } 
80    
81       double real; 
82       double imag; 
83       int rootnumber; 
84       boolean isZero; 
85       Label Real; 
86       Label Imag; 
87       TextField realTxt; 
88       TextField imagTxt; 
89       Button okButton; 
90       Button cancelButton; 
91       SPlaneBean source; 
92   } 
93