next up previous contents
Next: Examples Up: Graphical Types Previous: The Graphical Types of

Customizing the Graph Browser Layout

 

To support the user in defining his own graphical types we provide classes describing typical examples of graphical types supported by the Andrew toolkit (ATK). Their class definition includes attributes for all important parameters such as font, shape, text alignment. These classes are organized in a specialization hierarchy below the object GraphicalType and include the objects shown in figure gif.

   figure1183
Figure: The predefined graphical type classes for the Andrew toolkit

Most of these types are self-explanatory. ATK_Iconnode and ATK_Pixmapnode enable the use of pixmaps as graphical symbols in the Graph Browser. Both take the name of the pixmap file (in string format) as attribute. They differ in the way they present the name of the corresponding object: for an iconnode the object name is presented below the pixmap while in case of a pixmapnode the name is centered within the pixmap. Please note that for all concrete graphical types (i.e. all instances of the ATK type classes above) the attribute WithShape must be specified, they are not inherited from the tytpe class! Admissible values are the instances of the class ATK_ShapeStyle; admissible values of the attributes LineCap, TextAlign, FontDesc, LineColor are the instances of the classes ATK_LineCap, ATK_TextAlign, ATK_Fonts, X11_Color, resp.

The definition of new presentation styles comprises three steps:

  1. Definition of graphical types by instantiating the Andrew shape classes. The class attributes specify the admissible parameters of the concrete graphical type. The specialization hierarchy guarantees that all graphical types are instances of the class GraphicalType
  2. Relating the new graphical types to objects. This can be done by defining an attribute of category graphtype for all objects that should be presented using the new graphical type, or by defining a rule that computes the graphical type of objects.
  3. Definition of a graphical palette by collecting graphical types which together form the new presentation style. This object must be an instance of the class GraphicalPalette, and references the individual graphical types using the contains attribute category. It must be guaranteed that for each object at most one of these graphical types is applicable. To catch all objects which do not contain a graphical type in the actual graphical palette, a default type can be specified by instantiating the default attribute of GraphicalPalette. The default graphical type is choosen whenever none of the other graphical types is specified for an answer object.

An example of user-defined graphical types can be found in gif.

For the graphical types ATK_Iconnode and ATK_Pixmapnode the attribute PixmapFile references the pixmap file name and location encoded in a string. The format of the pixmap file must be XPM3, which can be generated, e.g., using the xgrab tool. There exists a fixed sequence of places where the Graph Browser searches for the pixmap file:

  1. the Graph Browser interprets the string as the absolute path. If the string contains only the name of the file it searches in the directory where the CB Workbench was started.
  2. in the directory bitmap which is local to the users home directory
  3. in the directory $CB_HOME/lib/bitmap
  4. in case the Graph Browser cannot find a bitmap file with the specified name in one of the above direvtories, the Graph Browser uses the unknown pixmap as default.

next up previous contents
Next: Examples Up: Graphical Types Previous: The Graphical Types of

ConceptBase Team