/Users/lyon/j4p/src/sound/filterDesign/SPlaneBean.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:   SPlaneBean.java 
7     
8    import java.awt.*; 
9    import java.awt.event.*; 
10   import java.beans.PropertyChangeListener; 
11   import java.beans.PropertyChangeSupport; 
12   import java.io.Serializable; 
13   import java.util.Vector; 
14    
15   public class SPlaneBean extends Canvas 
16           implements Serializable, 
17                      MouseListener, 
18                      MouseMotionListener, 
19                      ActionListener, 
20                      BodeListener, 
21                      AutoscaleListener { 
22    
23       public SPlaneBean() { 
24           poleColor = Color.red; 
25           zeroColor = Color.blue; 
26           crossColor = Color.green; 
27           bodeListeners = new Vector(); 
28           myMouseListeners = new Vector(); 
29           pcs = new PropertyChangeSupport(this); 
30           hs = new HsFrame(); 
31           hs3D = new Hs3DFrame(); 
32           sFrame = new SPlaneFrame(this); 
33           editRoot = new EditRootFrame(this); 
34           poles = new Vector(); 
35           zeros = new Vector(); 
36           inside = false; 
37           newRoot = null; 
38           isZero = true; 
39           selectedRoot = false; 
40           delRoot = false; 
41           multi = false; 
42           Height = Width = 20; 
43           xMax = yMax = 2D; 
44           rootNumber = -1; 
45           thickness = 1; 
46           pop = new PopupMenu("Choose action"); 
47           m1 = new MenuItem("Add a pole"); 
48           pop.add(m1); 
49           m2 = new MenuItem("Add a zero"); 
50           pop.add(m2); 
51           pop.add("-"); 
52           m3 = new MenuItem("Add multiple pole"); 
53           pop.add(m3); 
54           m4 = new MenuItem("Add multiple zero"); 
55           pop.add(m4); 
56           pop.add("-"); 
57           m5 = new MenuItem("Delete pole/zero"); 
58           pop.add(m5); 
59           m6 = new MenuItem("No operation"); 
60           pop.add(m6); 
61           m7 = new MenuItem("Clear'em all"); 
62           pop.add(m7); 
63           pop.add("-"); 
64           m8 = new MenuItem("Rescale"); 
65           pop.add(m8); 
66           m9 = new Menu("Zoom"); 
67           m9_1 = new MenuItem("1/5"); 
68           m9.add(m9_1); 
69           m9_2 = new MenuItem("1/2"); 
70           m9.add(m9_2); 
71           m9_3 = new MenuItem(" 2 "); 
72           m9.add(m9_3); 
73           m9_4 = new MenuItem(" 5 "); 
74           m9.add(m9_4); 
75           m9_5 = new MenuItem(" 10 "); 
76           m9.add(m9_5); 
77           pop.add(m9); 
78           pop.add("-"); 
79           m10 = new MenuItem("Show |H(s)|"); 
80           pop.add(m10); 
81           m12 = new MenuItem("Show |H(s)|-3D"); 
82           pop.add(m12); 
83           m11 = new MenuItem("Set Parameters"); 
84           pop.add(m11); 
85           add(pop); 
86           setBackground(Color.white); 
87           setForeground(Color.black); 
88           setFont(new Font("Dialog", 0, 12)); 
89           setCursor(new Cursor(1)); 
90           addMouseListener(this); 
91           addMouseMotionListener(this); 
92           m1.addActionListener(this); 
93           m2.addActionListener(this); 
94           m3.addActionListener(this); 
95           m4.addActionListener(this); 
96           m5.addActionListener(this); 
97           m6.addActionListener(this); 
98           m7.addActionListener(this); 
99           m8.addActionListener(this); 
100          m9_1.addActionListener(this); 
101          m9_2.addActionListener(this); 
102          m9_3.addActionListener(this); 
103          m9_4.addActionListener(this); 
104          m9_5.addActionListener(this); 
105          m10.addActionListener(this); 
106          m11.addActionListener(this); 
107          m12.addActionListener(this); 
108      } 
109   
110      public synchronized void paint(Graphics g) { 
111          update(g); 
112      } 
113   
114      public synchronized void update(Graphics g) { 
115          Dimension dimension = getSize(); 
116          if (offGraphics == null || 
117                  dimension.width != offDimension.width || 
118                  dimension.height != offDimension.height) { 
119              offDimension = dimension; 
120              offImage = createImage(dimension.width, dimension.height); 
121              offGraphics = offImage.getGraphics(); 
122          } 
123          offGraphics.setColor(getBackground()); 
124          offGraphics.fillRect(0, 
125                  0, 
126                  offDimension.width, 
127                  offDimension.height); 
128          Width = getSize().width; 
129          Height = getSize().height; 
130          if (inside) { 
131              offGraphics.setColor(crossColor); 
132              offGraphics.drawLine(1, cursorY, Width - 2, cursorY); 
133              offGraphics.drawLine(cursorX, 1, cursorX, Height - 2); 
134          } 
135          drawPoleAndZero(offGraphics); 
136          offGraphics.setColor(getForeground()); 
137          if (newRoot != null) 
138              newRoot.draw(offGraphics, xMax, yMax, Width, Height); 
139          offGraphics.setColor(getForeground()); 
140          offGraphics.drawLine(0, Height / 2, Width, Height / 2); 
141          offGraphics.drawLine(Width / 2, 0, Width / 2, Height); 
142          offGraphics.drawRect(0, 0, Width - 1, Height - 1); 
143          offGraphics.drawLine(Width / 2 - 5, 
144                  Height / 4, 
145                  Width / 2 + 5, 
146                  Height / 4); 
147          offGraphics.drawString(d2str(yMax / 2D, 0), 
148                  Width / 2 + 9, 
149                  Height / 4 + 8); 
150          offGraphics.drawLine(Width / 2 - 5, 
151                  (3 * Height) / 4, 
152                  Width / 2 + 5, 
153                  (3 * Height) / 4); 
154          offGraphics.drawString(d2str(-yMax / 2D, 0), 
155                  Width / 2 + 5, 
156                  (3 * Height) / 4 + 8); 
157          offGraphics.drawLine(Width / 4, 
158                  Height / 2 - 5, 
159                  Width / 4, 
160                  Height / 2 + 5); 
161          offGraphics.drawString(d2str(-xMax / 2D, 0), 
162                  Width / 4 - 12, 
163                  Height / 2 + 16); 
164          offGraphics.drawLine((3 * Width) / 4, 
165                  Height / 2 - 5, 
166                  (3 * Width) / 4, 
167                  Height / 2 + 5); 
168          offGraphics.drawString(d2str(xMax / 2D, 0), 
169                  (3 * Width) / 4 - 8, 
170                  Height / 2 + 16); 
171          g.drawImage(offImage, 0, 0, this); 
172      } 
173   
174      public void actionPerformed(ActionEvent actionevent) { 
175          Object obj = actionevent.getSource(); 
176          if (obj == m1) { 
177              newPole(); 
178              return; 
179          } 
180          if (obj == m2) { 
181              newZero(); 
182              return; 
183          } 
184          if (obj == m3) { 
185              newMultiPole(); 
186              return; 
187          } 
188          if (obj == m4) { 
189              newMultiZero(); 
190              return; 
191          } 
192          if (obj == m5) { 
193              delRoot(); 
194              return; 
195          } 
196          if (obj == m6) { 
197              noop(); 
198              return; 
199          } 
200          if (obj == m7) { 
201              clear(); 
202              return; 
203          } 
204          if (obj == m8) { 
205              rescale(2D); 
206              return; 
207          } 
208          if (obj == m9_1) { 
209              xMax /= 5D; 
210              yMax /= 5D; 
211              repaint(); 
212              return; 
213          } 
214          if (obj == m9_2) { 
215              xMax /= 2D; 
216              yMax /= 2D; 
217              repaint(); 
218              return; 
219          } 
220          if (obj == m9_3) { 
221              xMax *= 2D; 
222              yMax *= 2D; 
223              repaint(); 
224              return; 
225          } 
226          if (obj == m9_4) { 
227              xMax *= 5D; 
228              yMax *= 5D; 
229              repaint(); 
230              return; 
231          } 
232          if (obj == m9_5) { 
233              xMax *= 10D; 
234              yMax *= 10D; 
235              repaint(); 
236              return; 
237          } 
238          if (obj == m10) { 
239              hs.wake(zeros, poles, getSize(), xMax, yMax); 
240              return; 
241          } 
242          if (obj == m11) { 
243              sFrame.wake(); 
244              return; 
245          } 
246          if (obj == m12) 
247              hs3D.wake(zeros, poles, xMax, yMax); 
248      } 
249   
250      public void mouseClicked(MouseEvent mouseevent) { 
251      } 
252   
253      public void mousePressed(MouseEvent mouseevent) { 
254          if ((mouseevent.getModifiers() & 4) == 4 || 
255                  mouseevent.isShiftDown()) 
256              pop.show(this, mouseevent.getX(), mouseevent.getY()); 
257          else if (newRoot != null) { 
258              if (isZero) 
259                  zeros.addElement(newRoot); 
260              else 
261                  poles.addElement(newRoot); 
262              fireBodeEvent( 
263                      new BodeEvent(this, 
264                              newRoot, 
265                              isZero ? 1 : 0, 
266                              rootNumber)); 
267              if (multi) { 
268                  if (isZero) 
269                      newRoot = new Zero(); 
270                  else 
271                      newRoot = new Pole(); 
272                  newRoot.setPos( 
273                          ((double) ((mouseevent.getX() - Width / 2) * 2) * 
274                          xMax) / 
275                          (double) Width, 
276                          ((double) ((Height / 2 - mouseevent.getY()) * 2) * 
277                          yMax) / 
278                          (double) Height); 
279              } else { 
280                  newRoot = null; 
281              } 
282              repaint(); 
283          } 
284          rootNumber = -1; 
285          if (!selectedRoot && newRoot == null) { 
286              int i = mouseevent.getX(); 
287              int j = mouseevent.getY(); 
288              int k = poles.size() - 1; 
289              int l = zeros.size() - 1; 
290              for (; !selectedRoot && k > -1; k--) 
291                  if (((Pole) poles.elementAt(k)).inRoot(xMax, 
292                          yMax, 
293                          Width, 
294                          Height, 
295                          i, 
296                          j)) { 
297                      selectedRoot = true; 
298                      isZero = false; 
299                      rootNumber = k; 
300                  } 
301   
302              for (; !selectedRoot && l > -1; l--) 
303                  if (((Zero) zeros.elementAt(l)).inRoot(xMax, 
304                          yMax, 
305                          Width, 
306                          Height, 
307                          i, 
308                          j)) { 
309                      selectedRoot = true; 
310                      isZero = true; 
311                      rootNumber = l; 
312                  } 
313   
314          } 
315          if (selectedRoot && mouseevent.getClickCount() == 2) 
316              if (isZero) 
317                  editRoot.wake(rootNumber, 
318                          isZero, 
319                          (Root) zeros.elementAt(rootNumber)); 
320              else 
321                  editRoot.wake(rootNumber, 
322                          isZero, 
323                          (Root) poles.elementAt(rootNumber)); 
324          if (delRoot && rootNumber != -1) { 
325              if (isZero) { 
326                  Root root = null; 
327                  zeros.removeElementAt(rootNumber); 
328                  fireBodeEvent(new BodeEvent(this, root, 5, rootNumber)); 
329                  delRoot = false; 
330              } else { 
331                  Root root1 = null; 
332                  poles.removeElementAt(rootNumber); 
333                  fireBodeEvent(new BodeEvent(this, root1, 4, rootNumber)); 
334                  delRoot = false; 
335              } 
336              selectedRoot = false; 
337              repaint(); 
338          } 
339      } 
340   
341      public void mouseReleased(MouseEvent mouseevent) { 
342          if (selectedRoot) { 
343              double d; 
344              double d1; 
345              if (isZero) { 
346                  d = ((Zero) zeros.elementAt(rootNumber)).getReal(); 
347                  d1 = ((Zero) zeros.elementAt(rootNumber)).getImag(); 
348              } else { 
349                  d = ((Pole) poles.elementAt(rootNumber)).getReal(); 
350                  d1 = ((Pole) poles.elementAt(rootNumber)).getImag(); 
351              } 
352              if (Math.abs(d) > xMax) 
353                  xMax = Math.abs(d); 
354              if (Math.abs(d1) > yMax) 
355                  yMax = Math.abs(d1); 
356              repaint(); 
357          } 
358          selectedRoot = false; 
359      } 
360   
361      public void mouseEntered(MouseEvent mouseevent) { 
362          inside = true; 
363      } 
364   
365      public void mouseExited(MouseEvent mouseevent) { 
366          inside = false; 
367          fireMyMouseEvent(new MyMouseEvent(this, "SPlane", 0.0D, 0.0D)); 
368          repaint(); 
369      } 
370   
371      public void mouseMoved(MouseEvent mouseevent) { 
372          cursorX = mouseevent.getX(); 
373          cursorY = mouseevent.getY(); 
374          if (newRoot != null) 
375              newRoot.setPos( 
376                      ((double) ((cursorX - Width / 2) * 2) * xMax) / 
377                      (double) Width, 
378                      ((double) ((Height / 2 - cursorY) * 2) * yMax) / 
379                      (double) Height); 
380          repaint(); 
381          fireMyMouseEvent( 
382                  new MyMouseEvent(this, 
383                          "SPlane", 
384                          ((double) ((cursorX - Width / 2) * 2) * xMax) / 
385                  (double) Width, 
386                          ((double) ((Height / 2 - cursorY) * 2) * yMax) / 
387                  (double) Height)); 
388      } 
389   
390      public void mouseDragged(MouseEvent mouseevent) { 
391          cursorX = mouseevent.getX(); 
392          cursorY = mouseevent.getY(); 
393          if (selectedRoot) 
394              if (isZero) { 
395                  ((Zero) zeros.elementAt(rootNumber)).setPos( 
396                          ((double) ((cursorX - Width / 2) * 2) * xMax) / 
397                          (double) Width, 
398                          ((double) ((Height / 2 - cursorY) * 2) * yMax) / 
399                          (double) Height); 
400                  fireBodeEvent( 
401                          new BodeEvent(this, 
402                                  (Root) zeros.elementAt(rootNumber), 
403                                  3, 
404                                  rootNumber)); 
405              } else { 
406                  ((Pole) poles.elementAt(rootNumber)).setPos( 
407                          ((double) ((cursorX - Width / 2) * 2) * xMax) / 
408                          (double) Width, 
409                          ((double) ((Height / 2 - cursorY) * 2) * yMax) / 
410                          (double) Height); 
411                  fireBodeEvent( 
412                          new BodeEvent(this, 
413                                  (Root) poles.elementAt(rootNumber), 
414                                  2, 
415                                  rootNumber)); 
416              } 
417          repaint(); 
418          fireMyMouseEvent( 
419                  new MyMouseEvent(this, 
420                          "SPlane", 
421                          ((double) ((cursorX - Width / 2) * 2) * xMax) / 
422                  (double) Width, 
423                          ((double) ((Height / 2 - cursorY) * 2) * yMax) / 
424                  (double) Height)); 
425      } 
426   
427      public void changeOccured(BodeEvent bodeevent) { 
428          if (bodeevent.getSource() != this) { 
429              switch (bodeevent.getType()) { 
430                  default: 
431                      break; 
432   
433                  case 0: // '\0' 
434                      poles.addElement(new Pole((Pole) bodeevent.getRoot())); 
435                      break; 
436   
437                  case 1: // '\001' 
438                      zeros.addElement(new Zero((Zero) bodeevent.getRoot())); 
439                      break; 
440   
441                  case 2: // '\002' 
442                      ((Pole) poles.elementAt(bodeevent.getPosition())).setPos( 
443                              bodeevent.getRoot().getReal(), 
444                              bodeevent.getRoot().getImag()); 
445                      break; 
446   
447                  case 3: // '\003' 
448                      ((Zero) zeros.elementAt(bodeevent.getPosition())).setPos( 
449                              bodeevent.getRoot().getReal(), 
450                              bodeevent.getRoot().getImag()); 
451                      break; 
452   
453                  case 4: // '\004' 
454                      poles.removeElementAt(bodeevent.getPosition()); 
455                      break; 
456   
457                  case 5: // '\005' 
458                      zeros.removeElementAt(bodeevent.getPosition()); 
459                      break; 
460   
461                  case 6: // '\006' 
462                      zeros.removeAllElements(); 
463                      poles.removeAllElements(); 
464                      break; 
465   
466                  case 7: // '\007' 
467                      Vector vector = bodeevent.getPoles(); 
468                      synchronized (this) { 
469                          if (vector != null) { 
470                              poles.removeAllElements(); 
471                              for (int i = 0; i < vector.size(); i++) 
472                                  poles.addElement( 
473                                          new Pole( 
474                                                  (Pole) vector.elementAt(i))); 
475   
476                          } 
477                      } 
478                      break; 
479   
480                  case 8: // '\b' 
481                      Vector vector1 = bodeevent.getZeros(); 
482                      synchronized (this) { 
483                          if (vector1 != null) { 
484                              zeros.removeAllElements(); 
485                              for (int j = 0; j < vector1.size(); j++) 
486                                  zeros.addElement( 
487                                          new Zero( 
488                                                  (Zero) vector1.elementAt( 
489                                                          j))); 
490   
491                          } 
492                      } 
493                      break; 
494   
495                  case 9: // '\t' 
496                      Vector vector2 = bodeevent.getPoles(); 
497                      Vector vector3 = bodeevent.getZeros(); 
498                      synchronized (this) { 
499                          if (vector2 != null) { 
500                              poles.removeAllElements(); 
501                              for (int k = 0; k < vector2.size(); k++) 
502                                  poles.addElement( 
503                                          new Pole( 
504                                                  (Pole) vector2.elementAt( 
505                                                          k))); 
506   
507                          } 
508                          if (vector3 != null) { 
509                              zeros.removeAllElements(); 
510                              for (int l = 0; l < vector3.size(); l++) 
511                                  zeros.addElement( 
512                                          new Zero( 
513                                                  (Zero) vector3.elementAt( 
514                                                          l))); 
515   
516                          } 
517                      } 
518                      break; 
519              } 
520              repaint(); 
521          } 
522      } 
523   
524      public synchronized void autoscaleOccured( 
525              AutoscaleEvent autoscaleevent) { 
526          rescale(autoscaleevent.factor); 
527      } 
528   
529      public synchronized void drawPoleAndZero(Graphics g) { 
530          g.setColor(poleColor); 
531          for (int i = 0; i < poles.size(); i++) 
532              ((Root) poles.elementAt(i)).draw(g, 
533                      xMax, 
534                      yMax, 
535                      Width, 
536                      Height); 
537   
538          g.setColor(zeroColor); 
539          for (int j = 0; j < zeros.size(); j++) 
540              ((Root) zeros.elementAt(j)).draw(g, 
541                      xMax, 
542                      yMax, 
543                      Width, 
544                      Height); 
545   
546      } 
547   
548      public synchronized void changeRoot(int i, 
549                                          boolean flag, 
550                                          double d, 
551                                          double d1) { 
552          if (flag) { 
553              ((Zero) zeros.elementAt(i)).setPos(d, d1); 
554              fireBodeEvent( 
555                      new BodeEvent(this, (Root) zeros.elementAt(i), 3, i)); 
556          } else { 
557              ((Pole) poles.elementAt(i)).setPos(d, d1); 
558              fireBodeEvent( 
559                      new BodeEvent(this, (Root) poles.elementAt(i), 2, i)); 
560          } 
561          repaint(); 
562      } 
563   
564      public synchronized void newPole() { 
565          newRoot = new Pole(); 
566          isZero = false; 
567          delRoot = false; 
568          multi = false; 
569      } 
570   
571      public synchronized void newZero() { 
572          newRoot = new Zero(); 
573          isZero = true; 
574          delRoot = false; 
575          multi = false; 
576      } 
577   
578      public synchronized void newMultiPole() { 
579          newRoot = new Pole(); 
580          isZero = false; 
581          delRoot = false; 
582          multi = true; 
583      } 
584   
585      public synchronized void newMultiZero() { 
586          newRoot = new Zero(); 
587          isZero = true; 
588          delRoot = false; 
589          multi = true; 
590      } 
591   
592      public synchronized void delRoot() { 
593          newRoot = null; 
594          delRoot = true; 
595      } 
596   
597      public synchronized void noop() { 
598          newRoot = null; 
599          delRoot = false; 
600          repaint(); 
601      } 
602   
603      public synchronized void clear() { 
604          fireBodeEvent(new BodeEvent(this)); 
605          newRoot = null; 
606          delRoot = false; 
607          rootNumber = 0; 
608          poles.removeAllElements(); 
609          zeros.removeAllElements(); 
610          repaint(); 
611      } 
612   
613      public synchronized void rescale(double d) { 
614          boolean flag = false; 
615          if (d == 0.0D) 
616              d = 2D; 
617          if (poles.size() != 0) { 
618              xMax = d * Math.abs(((Pole) poles.elementAt(0)).getReal()); 
619              yMax = d * Math.abs(((Pole) poles.elementAt(0)).getImag()); 
620              for (int i = 1; i < poles.size(); i++) { 
621                  Pole pole = (Pole) poles.elementAt(i); 
622                  if (Math.abs(d * pole.getReal()) > xMax) 
623                      xMax = d * Math.abs(pole.getReal()); 
624                  if (Math.abs(d * pole.getImag()) > yMax) 
625                      yMax = d * Math.abs(pole.getImag()); 
626              } 
627   
628              flag = true; 
629          } else { 
630              xMax = yMax = 2D; 
631          } 
632          if (zeros.size() != 0) { 
633              boolean flag1 = false; 
634              if (!flag) { 
635                  xMax = d * Math.abs(((Zero) zeros.elementAt(0)).getReal()); 
636                  yMax = d * Math.abs(((Zero) zeros.elementAt(0)).getImag()); 
637                  flag1 = true; 
638              } 
639              for (int j = ((flag1) ? 1 : 0); j < zeros.size(); j++) { 
640                  Zero zero = (Zero) zeros.elementAt(j); 
641                  if (Math.abs(d * zero.getReal()) > xMax) 
642                      xMax = d * Math.abs(zero.getReal()); 
643                  if (Math.abs(d * zero.getImag()) > yMax) 
644                      yMax = d * Math.abs(zero.getImag()); 
645              } 
646   
647          } 
648          if (xMax == 0.0D) 
649              xMax = 1.0D; 
650          if (yMax == 0.0D) 
651              yMax = 1.0D; 
652      } 
653   
654      public void setXAxis(double d) { 
655          xMax = Math.abs(d); 
656          repaint(); 
657      } 
658   
659      public void setYAxis(double d) { 
660          yMax = Math.abs(d); 
661          repaint(); 
662      } 
663   
664      public String d2str(double d, int i) { 
665          int j = 0xa ^ i; 
666          return Double.toString(Math.rint(d * (double) j) / (double) j); 
667      } 
668   
669      public void changeRootPos(double d, double d1) { 
670          if (isZero) 
671              ((Zero) zeros.elementAt(rootNumber)).setPos(d, d1); 
672          else 
673              ((Pole) poles.elementAt(rootNumber)).setPos(d, d1); 
674          if (Math.abs(d) > xMax) 
675              xMax = Math.abs(d); 
676          if (Math.abs(d1) > yMax) 
677              yMax = Math.abs(d1); 
678          repaint(); 
679      } 
680   
681      public void newParams(Vector vector) { 
682          params = vector; 
683          xMax = ((Double) params.elementAt(0)).doubleValue(); 
684          yMax = ((Double) params.elementAt(1)).doubleValue(); 
685          thickness = ((Integer) params.elementAt(2)).intValue(); 
686          repaint(); 
687      } 
688   
689      public Vector oldParams() { 
690          params = new Vector(); 
691          params.addElement(new Double(xMax)); 
692          params.addElement(new Double(yMax)); 
693          return params; 
694      } 
695   
696      public synchronized void addMyMouseListener( 
697              MyMouseListener mymouselistener) { 
698          myMouseListeners.addElement(mymouselistener); 
699      } 
700   
701      public synchronized void removeMyMouseListener( 
702              MyMouseListener mymouselistener) { 
703          myMouseListeners.removeElement(mymouselistener); 
704      } 
705   
706      public void fireMyMouseEvent(MyMouseEvent mymouseevent) { 
707          Vector vector = null; 
708          synchronized (this) { 
709              vector = (Vector) myMouseListeners.clone(); 
710          } 
711          for (int i = 0; i < vector.size(); i++) { 
712              MyMouseListener mymouselistener = (MyMouseListener) vector.elementAt( 
713                      i); 
714              mymouselistener.mouseOccured(mymouseevent); 
715          } 
716   
717      } 
718   
719      public synchronized void addBodeListener(BodeListener bodelistener) { 
720          bodeListeners.addElement(bodelistener); 
721      } 
722   
723      public synchronized void removeBodeListener(BodeListener bodelistener) { 
724          bodeListeners.removeElement(bodelistener); 
725      } 
726   
727      public void fireBodeEvent(BodeEvent bodeevent) { 
728          Vector vector = null; 
729          synchronized (this) { 
730              vector = (Vector) bodeListeners.clone(); 
731          } 
732          for (int i = 0; i < vector.size(); i++) { 
733              BodeListener bodelistener = (BodeListener) vector.elementAt(i); 
734              bodelistener.changeOccured(bodeevent); 
735          } 
736   
737      } 
738   
739      public void addPropertyChangeListener( 
740              PropertyChangeListener propertychangelistener) { 
741          pcs.addPropertyChangeListener(propertychangelistener); 
742      } 
743   
744      public void removePropertyChangeListener( 
745              PropertyChangeListener propertychangelistener) { 
746          pcs.removePropertyChangeListener(propertychangelistener); 
747      } 
748   
749      public void setFontSize(int i) { 
750          Font font = getFont(); 
751          setFont(new Font(font.getName(), font.getStyle(), i)); 
752          pcs.firePropertyChange("fontSize", 
753                  new Integer(font.getSize()), 
754                  new Integer(i)); 
755      } 
756   
757      public void setFont(Font font) { 
758          Font font1 = getFont(); 
759          super.setFont(font); 
760          pcs.firePropertyChange("font", font1, font); 
761      } 
762   
763      public void setBackground(Color color) { 
764          Color color1 = getBackground(); 
765          super.setBackground(color); 
766          pcs.firePropertyChange("background", color1, color); 
767      } 
768   
769      public void setForeground(Color color) { 
770          Color color1 = getForeground(); 
771          super.setForeground(color); 
772          pcs.firePropertyChange("foreground", color1, color); 
773      } 
774   
775      public void setPoleColor(Color color) { 
776          poleColor = color; 
777          repaint(); 
778      } 
779   
780      public Color getPoleColor() { 
781          return poleColor; 
782      } 
783   
784      public void setZeroColor(Color color) { 
785          zeroColor = color; 
786          repaint(); 
787      } 
788   
789      public Color getZeroColor() { 
790          return zeroColor; 
791      } 
792   
793      public void setCrossColor(Color color) { 
794          crossColor = color; 
795          repaint(); 
796      } 
797   
798      public Color getCrossColor() { 
799          return crossColor; 
800      } 
801   
802      public Dimension getMinimumSize() { 
803          return new Dimension(40, 40); 
804      } 
805   
806      private boolean inside; 
807      private boolean isZero; 
808      private boolean selectedRoot; 
809      private boolean delRoot; 
810      private boolean multi; 
811      private int cursorX; 
812      private int cursorY; 
813      private int rootNumber; 
814      private double xMax; 
815      private double yMax; 
816      private Vector zeros; 
817      private Vector poles; 
818      private Root newRoot; 
819      int Width; 
820      int Height; 
821      int thickness; 
822      HsFrame hs; 
823      Hs3DFrame hs3D; 
824      SPlaneFrame sFrame; 
825      EditRootFrame editRoot; 
826      Vector params; 
827      private Color poleColor; 
828      private Color zeroColor; 
829      private Color crossColor; 
830      private PopupMenu pop; 
831      private MenuItem m1; 
832      private MenuItem m2; 
833      private MenuItem m3; 
834      private MenuItem m4; 
835      private MenuItem m5; 
836      private MenuItem m6; 
837      private MenuItem m7; 
838      private MenuItem m8; 
839      private MenuItem m9_1; 
840      private MenuItem m9_2; 
841      private MenuItem m9_3; 
842      private MenuItem m9_4; 
843      private MenuItem m9_5; 
844      private MenuItem m10; 
845      private MenuItem m11; 
846      private MenuItem m12; 
847      private Menu m9; 
848      private Dimension offDimension; 
849      private transient Image offImage; 
850      private transient Graphics offGraphics; 
851      private Vector bodeListeners; 
852      private Vector myMouseListeners; 
853      private PropertyChangeSupport pcs; 
854  } 
855