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

  1. //****************************************************************************
  2. // ---- version information ----
  3. //
  4. // TwoNorPort.java       v 1.00 b1
  5. // Written by:           I. van Rienen / E-mail ivr@bart.nl
  6. // URL:                  http://www/bart.nl/~ivr
  7. // Initial release:
  8. // Released in public domain:
  9. //
  10. // ---- Description ----
  11. // Java class containing methods for a 2-input NOR port
  12. //
  13. // This program and the Java source is in the public domain.
  14. // Permission to use, copy, modify, and distribute this software
  15. // and its documentation for NON-COMMERCIAL purposes and
  16. // without fee is hereby granted.
  17. //
  18. //    Copyright 1996
  19. //
  20. //    Iwan van Rienen
  21. //    Joan Maetsuyckerstr. 145
  22. //    2593 ZG  The Hague
  23. //    The Netherlands
  24. //
  25. // I am not responsible for any bugs in this program and
  26. // possible damage to hard- or software when using this program.
  27. //****************************************************************************
  28. import java.applet.Applet;
  29. import java.awt.*;
  30. import java.util.Vector;
  31.  
  32. class TwoNorPort extends OrPort {
  33.  
  34. //----------------------------------------------------------------------------
  35. // The constructor of a 2-input NOR port
  36. //----------------------------------------------------------------------------
  37.     public TwoNorPort(Pin PinGrid[][], int x, int y) {
  38.         super(2, x, y, ComponentPin.PIN_TEXT_INVISIBLE | ComponentPin.PIN_NEGATIVE);
  39.         ComponentName = "2-input NOR port";
  40.         ClassName = "TwoNorPort";
  41.         IPin[0] = new InputPin("A", 1, 2, 2, 0, 0, 0, ComponentPin.PIN_TEXT_INVISIBLE);
  42.         IPin[1] = new InputPin("B", 1, 4, 2, 0, 0, 0, ComponentPin.PIN_TEXT_INVISIBLE);
  43.         RegisterPins (PinGrid, x, y);
  44.     }
  45.  
  46. //----------------------------------------------------------------------------
  47. // The constructor of a new 2-input NOR port, which is a copy of CompToCopy
  48. //----------------------------------------------------------------------------
  49.     public TwoNorPort (ElectronicComponent CompToCopy, int xo, int yo) {
  50.         super (CompToCopy, xo, yo);
  51.     }
  52.  
  53. //----------------------------------------------------------------------------
  54. // Method for copying this component.
  55. //----------------------------------------------------------------------------
  56.    public ElectronicComponent Copy(int xo, int yo) {
  57.         TwoNorPort NewComponent = new TwoNorPort(this, xo, yo);
  58.         return NewComponent;
  59.     }
  60. }