home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / ed8n1t2i / analyzerframe.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  2.6 KB  |  75 lines

  1. //****************************************************************************
  2. // ---- version information ----
  3. //
  4. // AnalyzerFrame.java    v 1.00b2
  5. // Written by:           I. van Rienen / E-mail ivr@bart.nl
  6. // URL:                  http://www/bart.nl/~ivr
  7. // Initial release:           v 1.00b1 01-03-1996
  8. //                            v 1.00b2 06-03-1996 Sun image update bug fixed
  9. //                                     07-03-1996 Linux Image offset bug fixed
  10. //                                                (AnalyzerPanel added)
  11. // Released in public domain: v 1.00b1 01-03-1996
  12. //
  13. // ---- Description ----
  14. // Java class containing methods for the the logic analyzer.
  15. //
  16. // This program and the Java source is in the public domain.
  17. // Permission to use, copy, modify, and distribute this software
  18. // and its documentation for NON-COMMERCIAL purposes and
  19. // without fee is hereby granted.
  20. //
  21. //    Copyright 1996
  22. //
  23. //    Iwan van Rienen
  24. //    Joan Maetsuyckerstr. 145
  25. //    2593 ZG  The Hague
  26. //    The Netherlands
  27. //
  28. // I am not responsible for any bugs in this program and
  29. // possible damage to hard- or software when using this program.
  30. //****************************************************************************
  31. import java.awt.*;
  32. import java.util.Vector;
  33.  
  34. class AnalyzerFrame extends Frame {
  35.     DigSim applet;
  36.     AnalyzerPanel MyAnalyzerPanel = null;
  37.  
  38. //----------------------------------------------------------------------------
  39. // The constructor of the Logic Analyzer Frame
  40. //----------------------------------------------------------------------------
  41.     public AnalyzerFrame(DigSim app) {
  42.         super("Logic analyzer");
  43.         applet = app;
  44.  
  45.         setLayout(new BorderLayout());
  46.         add("Center", MyAnalyzerPanel = new AnalyzerPanel(app, this));
  47.  
  48.         resize(400, 250);
  49.         show();
  50.         resize(400, 250);
  51.         repaint();
  52.     }
  53.  
  54. //----------------------------------------------------------------------------
  55. // Paint the Analyzer
  56. //----------------------------------------------------------------------------
  57.     public void paint (Graphics g) {
  58.         if (MyAnalyzerPanel != null) {
  59.             MyAnalyzerPanel.repaint();
  60.         }
  61.     }
  62.  
  63. //----------------------------------------------------------------------------
  64. // Handle the events of the analyzer
  65. //----------------------------------------------------------------------------
  66.     public boolean handleEvent(Event ev) {
  67.         if (ev.id == Event.WINDOW_DESTROY) {
  68.             hide();
  69.             applet.MyAnalyzerFrame = null;
  70.             return true;
  71.         }
  72.         return super.handleEvent(ev);
  73.     }
  74.  
  75. }