home *** CD-ROM | disk | FTP | other *** search
- /* SVConnector.m
- * Written By: Thomas Burkholder
- *
- * You may freely copy, distribute, and reuse the code in this example.
- * NeXT disclaims any warranty of any kind, expressed or implied, as to its
- * fitness for any particular use.
- */
-
- #import "SVConnector.h"
- #import "SwitchView.h"
-
- @implementation SVConnector
-
- - setSource:anObject
- {
- source = anObject;
- return self;
- }
-
- - source
- {
- return source;
- }
-
- - setDestination:anObject
- {
- destination = anObject;
- return self;
- }
-
- - destination
- {
- return destination;
- }
-
- - establishConnection
- {
- return self;
- }
-
- - nibInstantiate
- {
- // by experimentation, we know IB calls the connectors in the reverse
- // order that the connections were added to the document.
-
- [[source views] insertObject:destination at:0];
- return self;
- }
-
- - renewObject:old to:new
- {
- if (old == source)
- source = new;
- else if (old == destination)
- destination = new;
- return self;
- }
-
- - read:(NXTypedStream *)stream
- {
- [super read:stream];
- source = NXReadObject(stream);
- destination = NXReadObject(stream);
- return self;
- }
-
- - write:(NXTypedStream *)stream
- {
- [super write:stream];
- NXWriteObject(stream, source);
- NXWriteObject(stream, destination);
- return self;
- }
-
- - free
- {
- return [super free];
- }
-
- @end
-