CDSatellitesDoc.tioga
Copyright © 1985 by Xerox Corporation. All rights reserved.
Written by: Pradeep Sindhu, December 23, 1985 4:23:09 pm PST
Pradeep Sindhu, February 2, 1986 8:59:20 pm PST
CDSATELLITES: WSIWYG CHIPNDALE PROPERTIES
CDSATELLITES: WSIWYG CHIPNDALE PROPERTIES
CDSATELLITES: WSIWYG CHIPNDALE PROPERTIES
DATOOLS — FOR INTERNAL XEROX USE ONLY
DATOOLS — FOR INTERNAL XEROX USE ONLY
DATOOLS — FOR INTERNAL XEROX USE ONLY
CDSatellites: WSIWYG ChipNDale Properties
Release as [DATools]<DATools6.0>CDSatellites22>CDSatellitesDoc.tioga, .press

© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: CDSatellites provide a way to associate arbitrary textual information such as names and expressions with Chipndale instances. A useful way to think about satellites is that they are visible properties on instances. There are three key features of satellites that distinguish them from ordinary properties, however: they require no explicit action on the part of a user to display them, their looks and placement are entirely under user control, and they are simply text strings with no hidden semantics.
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304



For Internal Xerox Use Only
Contents
Basics
Programming Interface
User Interface
Running CDSatellites
Acknowledgements
Appendix A: Problems with the Instance List Method
Basics
Satellites provide a way to associate arbitrary textual information such as names and expressions with Chipndale instances. This document describes all users need to know about satellites in order to use them.
A satellite is an instance of Chipndale text that has been associated explicitly with another (non-text) Chipndale instance called the satellite's master; a master along with its satellites is called a satellite group. A satellite group exists in a world, which is a list of Chipndale instances that is either the contents of some Chipndale cell or of the top level of the design.
A useful model of satellites is that they are visible properties attached to the master. However, there are three key differences between satellites and ordinary properties: First, satellites are always visible while a user must do something explicit to display properties. Second, the user has complete control over the looks and placement of satellites, while properties are displayed in a fixed way. Finally, satellites are simply text strings; this is in contrast with properties, which have type information associated with them.
The association between a master and its satellites is made via a special groupIdProp property attached to each. The value of this property is an integer that is unique (within the design) to the satellite group in question. This method of associating group members is convenient for interactive purposes, but unfortunately it is not sufficient for a reasonable programming interface. The problem is that in order to find an instance's satellites we need to know the world in which these satellites exist. For many applications carrying around the world is inconvenient, so it behooves us to provide a way to find an instance's satellites given just the instance. This more convenient way is provided by putting a satellitesProp property on the master, which has as its value the list of text instances that are the master's satellites. (If you're wondering why just having the list of text instances alone does not suffice see Appendix A.)
Satellites satisfy a number of invariants which may be taken as a definition for satellites:
1. A master must be a non-text CD.Instance with a non-nil groupIdProp.
2. A satellite must be a text CD.Instance with a non-nil groupIdProp.
3. Every satellite in a given world must have a corresponding master in that world.
4. A design may have at most one master with a given groupId.
5. Each master must have a satellitesProp property that gives its list of satellites.
Programming Interface
The programming interface provides procedures to add, remove, and retrieve satellites from a given master. A final procedure allows clients to guarantee that the defining invariants are preserved after manipulation.
AddSatellite: PROC [design: CD.Design, master: CD.Instance, satellite: CD.Instance];
This procedure adds satellite to master if satellite isn't already present; old satellites of the master are preserved. No checks are made to ensure that the operation preserves the satellite invariants. Thus the caller must ensure that satellite and master are both legal, and that satellite is in master's world.
RemoveSatellite: PROC [world: InstanceList, satellite: CD.Instance];
This procedure removes satellite from its master. Again no checks are made that the operation preserves invariants. The caller must guarantee that satellite is present in world.
GetSatellites: PROC [master: CD.Instance] RETURNS [satellites: InstanceList ← NIL];
This procedure returns the satellites for master. It preserves the satellite invariants trivially.
GetSatelliteRopes: PROC [masterProps: CD.PropList] RETURNS [ropes: LIST OF ROPENIL];
This is a convenience procedure that returns the list of satellite ropes given the master's property list masterProps. It preserves the satellite invariants trivially.
EnforceInvariants: PROC [design: CD.Design, world: InstanceList];
This procedure enforces the satellite invariants for all satellite groups in world.
User Interface
Satellite Commands
The user interface consists of three commands: Select Group, Add Satellite, and Set Satellites, all of which are available via the Satellites menu (Space-L).
Show Satellites selects the satellite group to which the currently selected instance belongs. Multiple selections are not allowed. This command may also be executed directly via L-LeftClick.
Add Satellite prompts for text and makes that text a satellite of the currently selected instance. Multiple selections are not allowed, and the current selection must not be a text instance. This command may also be executed directly via L-MiddleClick.
Set Satellites takes a single non-text instance and zero or more text instances and makes the text instances satellites of the non-text instance. If the non-text instance was a master already, it loses its old satellites. Multiple non-text instances are not allowed in the selection. This command may also be executed directly via the L-RightClick.
Subtleties
Considerable care has been taken in the design of satellites to ensure that they mesh well with other Chipndale commands. In almost all cases the "right" thing will happen when these commands are used on instances that are in a satellite group:
Copy: If the selection contains just satellites, then the new copies are added to the master's list of satellites. If the selection contains a master, then a new group is created, with the new satellites being associated with the new master and the old ones with the old.
Delete: If the deleted instance is a master then its satellites will become ordinary pieces of text. If the deleted instance is a satellite then that satellite will get removed from its group.
Undelete: The undelete will preserve all satellite groupings back up until the last satellite command was executed. So, for example, if you delete a master and then do a number of non-satellite commands and then undelete that master, the master's group will be reincarnated.
Stretch: If the instance being stretched is a master, it remains a master.
Replace Text: If the text was a satellite of some master then the replaced text replaces the old satellite of that master.
Running CDSatellites
To run CDSatellites you need to do the following:
1. Bringover [Datools]<Datools6.0>Top>CDSatellites22.df
2. Add the following line to your profile:
Tioga.ChipNDale.CMosB.TIP: CDSatellites.TIP Default
3. Type CDSatellites (Chipndale should have been run earlier)
Acknowledgements
The current version of satellites has gone through a number of redesigns and reimplementations as deficiencies were discovered and fixed, and several people have contributed their ideas and time. The initial implementation was by Louis Monier. A complete redesign was done by Bertrand Serlet and Pradeep Sindhu, followed by several iterations over this design. It took one more complete redesign and reimplmentation (by Pradeep Sindhu) to get to the current version.
Appendix A: Problems with the Instance List Method
There are two problems with just having a list of instances that records a master's satellites: the first takes a small matter of programming to fix, while the second is basic. The SMOP problem is that properties that have Cedar LIST's as values cannot be written out to Chipndale files. The basic problem is that Chipndale instances are not permanent entities—they can disappear and be replaced by an identical instance at any time (well, not any time, but you get the idea). Therefore we cannot cache REF's to instances.