home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscTeePalette / MiscTee.subproj / MiscTeeConnector.m < prev    next >
Encoding:
Text File  |  1994-10-22  |  1.8 KB  |  114 lines

  1. //
  2. //    MiscTeeConnector.m -- an IBConnector that allows a multitude of connections
  3. //                          to spread out from it.
  4. //
  5. //        Written by David Fedchenko.  Copyright 1994 by David Fedchenko.
  6. //                Version 1.0  All rights reserved.
  7. //
  8. //        This notice may not be removed from this source code.
  9. //
  10. //    This object is included in the MiscKit by permission from the author
  11. //    and its use is governed by the MiscKit license, found in the file
  12. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  13. //    for a list of all applicable permissions and restrictions.
  14. //    
  15.  
  16. #import "MiscTeeConnector.h"
  17. #import "MiscTee.h"
  18.  
  19. @implementation MiscTeeConnector
  20.  
  21. - setSource:anObject
  22.     {
  23.     idSource = anObject;
  24.  
  25.     return self;
  26.     }
  27.  
  28. - setDestination:anObject
  29.     {
  30.     idDest = anObject;
  31.  
  32.     return self;
  33.     }
  34.  
  35. - setAction:(SEL)anAction
  36.     {
  37.     selAction = anAction;
  38.     
  39.     return self;
  40.     }
  41.  
  42. - source
  43.     {
  44.     return idSource;
  45.     }
  46.  
  47. - destination
  48.     {
  49.     return idDest;
  50.     }
  51.  
  52. -(SEL) action
  53.     {
  54.     return selAction;
  55.     }
  56.  
  57. - establishConnection
  58.     {
  59.     [idSource addConnection:idDest with:selAction];
  60.  
  61.     return self;
  62.     }
  63.  
  64. - nibInstantiate
  65.     {
  66.     idSource = [idSource nibInstantiate];
  67.     idDest = [idDest nibInstantiate];
  68.     
  69.     return self;
  70.     }
  71.  
  72. - renewObject:old to:new
  73.     {
  74.     if (old == idSource)
  75.         {
  76.         idSource = new;
  77.         }
  78.     else if (old == idDest)
  79.         {
  80.         idDest = new;
  81.         }
  82.  
  83.     return self;
  84.     }
  85.  
  86. - read:(NXTypedStream *)stream
  87.     {
  88.     [super read:stream];
  89.     
  90.     NXReadType(stream, ":", &selAction);
  91.     idSource = NXReadObject(stream);
  92.     idDest = NXReadObject(stream);
  93.  
  94.     return self;
  95.     }
  96.  
  97. - write:(NXTypedStream *)stream
  98.     {
  99.     [super write:stream];
  100.  
  101.     NXWriteType(stream, ":", &selAction);
  102.     NXWriteObject(stream, idSource);
  103.     NXWriteObject(stream, idDest);
  104.  
  105.     return self;
  106.     }
  107.  
  108. - free
  109.     {
  110.     return [super free];
  111.     }
  112.  
  113. @end
  114.