Icons and Stars
This is an object model of the portion of the new
graph editors that deal with icons and stars, from
a discussion at group lunch 10/10/97. The model
has a couple of key innovations:
- The notion of a "terminal style." This separates the appearance
and location of terminals from the body of the icon itself. This
reduced the multiplicity of the displays-as association to one
(at the MetaIcon end), which in turn allows stars to be selected by
star name rather than by icon.
- The reduction of "domain" into a qualifier on additional parameters
for star. Thus, a star has a common set of parameters
shared by all domains; in addition, for each domain, it can choose to
have additional parameters.
Additional explanation follows the diagram. Note there is one piece of
notation that we have not yet covered in the UML meetings: the arrowed
lines (from Star to MetaStar and Icon to MetaIcon) are the notation
to indicate instantiation of metadata. (Metadata is "data that
describes data." For example, MetaStar is an object that describes
what a star is; Star is an object that is created from that
description. This is not the same as instantiating a class. An
analogy: an architectural drawing is the metadata for a house. See
Rumbaugh '91, section 4.5.)
Notes on the model:
- A StarSelector is the UI widget that selects stars. (Palette,
menu, listbox, etc.) It knows about an arbitrary number of star
libraries.
- A StarLibrary is a collection of MetaStars, indexed by
starname. Each MetaStar displays-as exactly one MetaIcon, which
in turn are collected into an IconLibrary. However, an icon can be
used to display more than star type.
- A MetaStar references MetaParm objects, each of which is
instantiated into a single parameter attribute of the actual
star. In addition, the domain selects an additional set of parameters
that the star will have.
- Stars are implemented as vertices of a PortedGraph
model. Each Star is created from the description in the corresponding
MetaStar.
- A MetaIcon contains one or more sets (should be one or more)
of MetaTerms, each describing a Terminal. Each TermSet is referenced
by a termstyle qualifier, which is duplicated in the Icon. The
UI allows a user to select from the available termstyles. Each time
this is done, the icon changes its Terminals to match the selected
termstyle. (This is how we avoid having to duplicate icons.) Each set
of MetaTerms can be referenced by many MetaIcons, thus allowing
terminal styles to be reused.
- Icons are created from the description in the corresponding
MetaIcon, and are contained in a Layout model. The appearance
attribute is a collection of graphical attributes that control the
on-screen appearance of the icon. Icons are dumb, graphical
objects. Each Icon and each Star are referenced by their respective
Layout and PortedGraph model by name -- these are equal for
each icon-star pair.
- Each icon contains a set of Terminal objects, which
represents ports of the star. (Omitted from the diagram...) Terminals
are created from MetaTerminals. Each icon also contains a DomainFlag,
which is a graphical marker (colored border, little rabbit sitting on
icon etc) that provides a visual indication of the domain of the star.
- The MetaGlyph class is additional metadata describing an
icon. Each icon is drawn with a glyph (graphical item) of a given
class. MetaGlyph provides the information needed by icon editors and
parameter boxes (for example, that let you change the color of an
icon). Putting the information into the MetaIcons would be
redundant.
JohnR, 10 Oct 97