/Users/lyon/j4p/src/sound/filterDesign/Hs3DFrame.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: Hs3DFrame.java
7
8 import java.awt.*;
9 import java.awt.event.*;
10 import java.util.Vector;
11
12 public class Hs3DFrame extends Frame
13 implements ActionListener, ItemListener {
14
15 public Hs3DFrame() {
16 super("| H(s) | in 3D");
17 canvas = new Hs3DCanvas();
18 mainMenu = new MenuBar();
19 help = new Menu("Help");
20 file = new Menu("Window");
21 bgcolor = new Menu("BG Color");
22 option = new Menu("Options");
23 grid = new Menu("Grid");
24 palette = new Menu("Palette");
25 close = new MenuItem("Close");
26 axes = new CheckboxMenuItem("Axis", true);
27 wire = new CheckboxMenuItem("Mesh", false);
28 value = new CheckboxMenuItem("Values", false);
29 surf = new CheckboxMenuItem("Surface", true);
30 rot = new CheckboxMenuItem("Rotate", false);
31 c1 = new CheckboxMenuItem("Black", true);
32 c2 = new CheckboxMenuItem("White", false);
33 c3 = new CheckboxMenuItem("Gray I", false);
34 c4 = new CheckboxMenuItem("Orange", false);
35 c5 = new CheckboxMenuItem("Pink", false);
36 c6 = new CheckboxMenuItem("Gray II", false);
37 c7 = new CheckboxMenuItem("Yellow", false);
38 g1 = new CheckboxMenuItem("10 X 10", false);
39 g2 = new CheckboxMenuItem("20 X 20", true);
40 g3 = new CheckboxMenuItem("30 X 30", false);
41 g4 = new CheckboxMenuItem("40 X 40", false);
42 p0 = new CheckboxMenuItem("Default", true);
43 p1 = new CheckboxMenuItem("Warm", false);
44 p2 = new CheckboxMenuItem("Cold", false);
45 file.add(close);
46 option.add(axes);
47 option.add(wire);
48 option.add(value);
49 option.add(surf);
50 option.add(rot);
51 palette.add(p0);
52 palette.add(p1);
53 palette.add(p2);
54 bgcolor.add(c1);
55 bgcolor.add(c2);
56 bgcolor.add(c3);
57 bgcolor.add(c4);
58 bgcolor.add(c5);
59 bgcolor.add(c6);
60 bgcolor.add(c7);
61 grid.add(g1);
62 grid.add(g2);
63 grid.add(g3);
64 grid.add(g4);
65 mainMenu.add(file);
66 mainMenu.add(bgcolor);
67 mainMenu.add(grid);
68 mainMenu.add(option);
69 mainMenu.add(palette);
70 mainMenu.setHelpMenu(help);
71 setMenuBar(mainMenu);
72 setSize(600, 600);
73 setCursor(new Cursor(1));
74 setVisible(false);
75 addWindowListener(new WindowAdapter() {
76
77 public void windowClosing(WindowEvent windowevent) {
78 setVisible(false);
79 canvas.stopThread();
80 }
81
82 });
83 close.addActionListener(this);
84 axes.addItemListener(this);
85 wire.addItemListener(this);
86 value.addItemListener(this);
87 surf.addItemListener(this);
88 rot.addItemListener(this);
89 c1.addItemListener(this);
90 c2.addItemListener(this);
91 c3.addItemListener(this);
92 c4.addItemListener(this);
93 c5.addItemListener(this);
94 c6.addItemListener(this);
95 c7.addItemListener(this);
96 g1.addItemListener(this);
97 g2.addItemListener(this);
98 g3.addItemListener(this);
99 g4.addItemListener(this);
100 p0.addItemListener(this);
101 p1.addItemListener(this);
102 p2.addItemListener(this);
103 add(canvas);
104 }
105
106 public void actionPerformed(ActionEvent actionevent) {
107 Object obj = actionevent.getSource();
108 if (obj == close) {
109 setVisible(false);
110 canvas.stopThread();
111 }
112 }
113
114 public void itemStateChanged(ItemEvent itemevent) {
115 Object obj = itemevent.getSource();
116 if (obj == c1) {
117 c1.setState(true);
118 c2.setState(false);
119 c3.setState(false);
120 c4.setState(false);
121 c5.setState(false);
122 c6.setState(false);
123 c7.setState(false);
124 canvas.newBgcolor(Color.black);
125 return;
126 }
127 if (obj == c2) {
128 c1.setState(false);
129 c2.setState(true);
130 c3.setState(false);
131 c4.setState(false);
132 c5.setState(false);
133 c6.setState(false);
134 c7.setState(false);
135 canvas.newBgcolor(Color.white);
136 return;
137 }
138 if (obj == c3) {
139 c1.setState(false);
140 c2.setState(false);
141 c3.setState(true);
142 c4.setState(false);
143 c5.setState(false);
144 c6.setState(false);
145 c7.setState(false);
146 canvas.newBgcolor(Color.gray);
147 return;
148 }
149 if (obj == c4) {
150 c1.setState(false);
151 c2.setState(false);
152 c3.setState(false);
153 c4.setState(true);
154 c5.setState(false);
155 c6.setState(false);
156 c7.setState(false);
157 canvas.newBgcolor(Color.orange);
158 return;
159 }
160 if (obj == c5) {
161 c1.setState(false);
162 c2.setState(false);
163 c3.setState(false);
164 c4.setState(false);
165 c5.setState(true);
166 c6.setState(false);
167 c7.setState(false);
168 canvas.newBgcolor(Color.pink);
169 return;
170 }
171 if (obj == c6) {
172 c1.setState(false);
173 c2.setState(false);
174 c3.setState(false);
175 c4.setState(false);
176 c5.setState(false);
177 c6.setState(true);
178 c7.setState(false);
179 canvas.newBgcolor(Color.lightGray);
180 return;
181 }
182 if (obj == c7) {
183 c1.setState(false);
184 c2.setState(false);
185 c3.setState(false);
186 c4.setState(false);
187 c5.setState(false);
188 c6.setState(false);
189 c7.setState(true);
190 canvas.newBgcolor(Color.yellow);
191 return;
192 }
193 if (obj == g1) {
194 g1.setState(true);
195 g2.setState(false);
196 g3.setState(false);
197 g4.setState(false);
198 canvas.newNpoints(10);
199 return;
200 }
201 if (obj == g2) {
202 g1.setState(false);
203 g2.setState(true);
204 g3.setState(false);
205 g4.setState(false);
206 canvas.newNpoints(20);
207 return;
208 }
209 if (obj == g3) {
210 g1.setState(false);
211 g2.setState(false);
212 g3.setState(true);
213 g4.setState(false);
214 canvas.newNpoints(30);
215 return;
216 }
217 if (obj == g4) {
218 g1.setState(false);
219 g2.setState(false);
220 g3.setState(false);
221 g4.setState(true);
222 canvas.newNpoints(40);
223 return;
224 }
225 if (obj == p0) {
226 p0.setState(true);
227 p1.setState(false);
228 p2.setState(false);
229 canvas.palette(0);
230 return;
231 }
232 if (obj == p1) {
233 p0.setState(false);
234 p1.setState(true);
235 p2.setState(false);
236 canvas.palette(1);
237 return;
238 }
239 if (obj == p2) {
240 p0.setState(false);
241 p1.setState(false);
242 p2.setState(true);
243 canvas.palette(2);
244 return;
245 }
246 if (obj == axes) {
247 canvas.axisOn(axes.getState());
248 return;
249 }
250 if (obj == wire) {
251 canvas.wireOn(wire.getState());
252 return;
253 }
254 if (obj == value) {
255 canvas.valueOn(value.getState());
256 return;
257 }
258 if (obj == surf) {
259 canvas.surfOn(surf.getState());
260 return;
261 }
262 if (obj == rot)
263 canvas.rotOn(rot.getState());
264 }
265
266 public void wake(Vector vector, Vector vector1, double d, double d1) {
267 canvas.newInfo(vector, vector1, d, d1);
268 setVisible(true);
269 }
270
271 Hs3DCanvas canvas;
272 MenuBar mainMenu;
273 Menu help;
274 Menu file;
275 Menu bgcolor;
276 Menu option;
277 Menu grid;
278 Menu palette;
279 MenuItem close;
280 CheckboxMenuItem c1;
281 CheckboxMenuItem c2;
282 CheckboxMenuItem c3;
283 CheckboxMenuItem c4;
284 CheckboxMenuItem c5;
285 CheckboxMenuItem c6;
286 CheckboxMenuItem c7;
287 CheckboxMenuItem g1;
288 CheckboxMenuItem g2;
289 CheckboxMenuItem g3;
290 CheckboxMenuItem g4;
291 CheckboxMenuItem axes;
292 CheckboxMenuItem wire;
293 CheckboxMenuItem value;
294 CheckboxMenuItem surf;
295 CheckboxMenuItem rot;
296 CheckboxMenuItem p0;
297 CheckboxMenuItem p1;
298 CheckboxMenuItem p2;
299 }
300