All Manuals > Common Lisp Interface Manager 2.0 User's Guide > Chapter 17 Formatted Output > 17.5 Advanced Topics

NextPrevUpTopContentsIndex

17.5.3 The Graph Formatting Protocol

graph-output-record [Protocol Class]	

Summary: The protocol class that represents a graph; a subclass of output-record . If you want to create a new class that behaves like a graph output record, it should be a subclass of graph-output-record . Subclasses of graph-output-record must obey the graph output record protocol.

graph-output-record-p [Function]	

Arguments: object

Summary: Returns t if object is a graph output record, otherwise returns nil .

:orientation

:center-nodes

:cutoff-depth

:merge-duplicates

:generation-separation

:within-generation-separation

:hash-table

Summary: All the graph output records must handle these seven initargs, which are used to specify, respectively, the orientation, node centering, cutoff depth, merge duplicates, generation and within-generation spacing, and the node hash table of a graph output record.

define-graph-type [Macro]	

Arguments: graph-type class

Summary: Defines a new graph type graph-type that is implemented by the class class (a subclass of graph-output-record ). Neither of the arguments is evaluated.

graph-root-nodes [Generic Function]

Arguments: graph-record

Summary: Returns a sequence of the graph node output records corresponding to the root objects for the graph output record graph-record .

(setf graph-root-nodes) [Generic Function]

Arguments: roots graph-record

Summary: Sets the root nodes of graph-record to roots .

generate-graph-nodes [Generic Function]

Arguments: graph-record stream root-objects object-printer inferior-producer &key duplicate-key duplicate-test

Summary: This function is responsible for generating all the graph node output records of the graph. graph-record is the graph output record, and stream is the output stream. The graph node output records are generating by calling the object printer on the root objects, then (recursively) calling the inferior producer on the root objects and calling the object printer on all inferiors. After all the graph node output records have been generated, the value of graph-root-nodes of graph-record must be set to be a sequence of those graph node output records that correspond to the root objects.

root-objects , object-printer , inferior-producer , duplicate-key , and duplicate-test are as for format-graph-from-roots .

layout-graph-nodes [Generic Function]

Arguments: graph-record stream

Summary: This function is responsible for laying out the nodes in the graph contained in the output record graph-record . It is called after the graph output has been collected, but before the graph record has been displayed. The method on standard-graph-output-record implements the usual graph layout constraint solver. stream is the stream on which the graph is displayed.

layout-graph-edges [Generic Function]

Arguments: graph-record stream arc-drawer arc-drawing-options

Summary: This function is responsible for laying out the edges in the graph. It is called after the graph nodes have been laid out, but before the graph record has been displayed. The method on standard-graph-output-record simply causes thin lines to be drawn from each node to all of its children. graph-record and stream are as for layout-graph-nodes .

graph-node-output-record [Protocol Class]	

Summary: The protocol class that represents a node in graph; a subclass of output-record . If you want to create a new class that behaves like a graph node output record, it should be a subclass of graph-node-output-record . Subclasses of graph-node-output-record must obey the graph node output record protocol.

graph-node-output-record-p [Function]	

Arguments: object

Summary: Returns t if object is a graph node output record; otherwise, it returns nil .

standard-graph-node-output-record

Summary: The instantiable class of output record that represents a graph node. Its parent will be a graph output record. This is a subclass of graph-node-output-record .

graph-node-parents [Generic Function]

Arguments: graph-node-record

Summary: Returns a sequence of the graph node output records whose objects are "parents" of the object corresponding to the graph node output record graph-node-record . This differs from output-record-parent , as graph-node-parents can return output records that are not the parent records of graph-node-record .

(setf graph-node-parents) [Generic Function]

Arguments: parents graph-node-record

Summary: Sets the parents of graph-node-record to be parents . parents must be a list of graph node records.

graph-node-children [Generic Function]

Arguments: graph-node-record

Summary: Returns a sequence of the graph node output records whose objects are "children" of the object corresponding to the graph node output record graph-node-record . This differs from output-record-children , as graph-node-children can return output records that are not child records of graph-node-record .

(setf graph-node-children) [Generic Function]

Arguments: children graph-node-record

Summary: Sets the children of graph-node-record to be children . children must be a list of graph node records.

graph-node-object [Generic Function]

Arguments: graph-node-record

Summary: Returns the object that corresponds to the output record graph-node-record . This function only works correctly while inside the call to format-graph-from-roots . Unspecified results are returned outside format-graph-from-roots , as CLIM does not capture application objects that might have dynamic extent.


Common Lisp Interface Manager 2.0 User's Guide - 3 Mar 2015

NextPrevUpTopContentsIndex