Home | Trees | Index | Help |
|
---|
|
A specialized dot graph node used to display ClassDocs using UML notation. The node is rendered as a table with three cells: the top cell contains the class name; the middle cell contains a list of attributes; and the bottom cell contains a list of operations:
+-------------+ | ClassName | +-------------+ | x: int | | ... | +-------------+ | f(self, x) | | ... | +-------------+
DotGraphUmlClassNodes may be collapsed, in which case they are drawn as a simple box containing the class name:
+-------------+ | ClassName | +-------------+
Attributes with types corresponding to documented classes can optionally be converted into edges, using link_attributes().
To Do: Add more options? - show/hide operation signature - show/hide operation signature types - show/hide operation signature return type - show/hide attribute types - use qualifiers
|
|||
__init__(self,
class_doc,
linker,
context,
collapsed=False,
bgcolor=CLASS_BG,
**options)
Create a new DotGraphUmlClassNode based on the class class_doc. |
|||
Inherited from |
|||
Attribute Linking | |||
---|---|---|---|
link_attributes(self,
nodes)
Convert any attributes with type descriptions corresponding to documented classes to edges. |
|||
_link_attribute(self,
var,
nodes)
Helper for link_attributes(): try to convert the attribute variable var into an edge, and add that edge to
self.edges.
|
|||
_add_attribute_edge(self,
var,
nodes,
type_str,
**attribs)
Helper for link_attribute() : try to add an edge for the
given attribute variable var .
|
|||
Helper Methods | |||
_summary(self,
api_doc)
Return a plaintext summary for api_doc
|
|||
_type_descr(self,
api_doc)
Return a plaintext type description for api_doc
|
|||
_tooltip(self,
var_doc)
Return a tooltip for var_doc .
|
|||
Rendering | |||
_attribute_cell(self, var_doc) | |||
_operation_cell(self, var_doc) | |||
_operation_arg(self, name, default, func_doc) | |||
_qualifier_cell(self, key_label, port) | |||
_get_html_label(self) | |||
to_dotfile(self)
Return the dot commands that should be used to render this node. |
|
|||
Inherited from |
|||
Attribute Linking | |||
---|---|---|---|
SIMPLE_TYPE_RE | A regular expression that matches descriptions of simple types. | ||
COLLECTION_TYPE_RE | A regular expression that matches descriptions of collection types. | ||
MAPPING_TYPE_RE | A regular expression that matches descriptions of mapping types. | ||
MAPPING_TO_COLLECTION_TYPE_RE | A regular expression that matches descriptions of mapping types whose value type is a collection. | ||
OPTIONAL_TYPE_RE | A regular expression that matches descriptions of optional types. | ||
Rendering | |||
_ATTRIBUTE_CELL | args: (url, tooltip, label) | ||
_OPERATION_CELL | args: (url, tooltip, label) | ||
_QUALIFIER_CELL | args: (port, bgcolor, label) | ||
_QUALIFIER_DIV | |||
_LABEL | Args: (rowspan, bgcolor, classname, attributes, operations, qualifiers) | ||
_COLLAPSED_LABEL |
|
|||
class_doc | The class represented by this node. | ||
linker | Used to look up URLs for classes. | ||
context | The context in which the node will be drawn. | ||
bgcolor | The background color of the node. | ||
options | Options used to control how the node is displayed. | ||
collapsed | If true, then draw this node as a simple box. | ||
attributes | The list of VariableDocs for attributes | ||
operations | The list of VariableDocs for operations | ||
qualifiers | List of (key_label, port) tuples. | ||
edges | List of edges used to represent this node's attributes. |
|
|
Convert any attributes with type descriptions corresponding to documented classes to edges. The following type descriptions are currently handled:
The edges created by
|
var into an edge, and add that edge to
self.edges. Return True iff the variable was
successfully converted to an edge (in which case, it should be
removed from the attributes list).
|
link_attribute() : try to add an edge for the
given attribute variable var . Return True if
successful.
|
api_doc
|
api_doc
|
var_doc .
|
|
|
|
|
|
|
|
SIMPLE_TYPE_REA regular expression that matches descriptions of simple types.
|
COLLECTION_TYPE_REA regular expression that matches descriptions of collection types.
|
MAPPING_TYPE_REA regular expression that matches descriptions of mapping types.
|
MAPPING_TO_COLLECTION_TYPE_REA regular expression that matches descriptions of mapping types whose value type is a collection.
|
OPTIONAL_TYPE_REA regular expression that matches descriptions of optional types.
|
_ATTRIBUTE_CELLargs: (url, tooltip, label)
|
_OPERATION_CELLargs: (url, tooltip, label)
|
_QUALIFIER_CELLargs: (port, bgcolor, label)
|
_QUALIFIER_DIV
|
_LABELArgs: (rowspan, bgcolor, classname, attributes, operations, qualifiers)
|
_COLLAPSED_LABEL
|
|
class_docThe class represented by this node. |
linkerUsed to look up URLs for classes. |
contextThe context in which the node will be drawn. |
bgcolorThe background color of the node. |
optionsOptions used to control how the node is displayed. |
collapsedIf true, then draw this node as a simple box. |
attributesThe list of VariableDocs for attributes |
operationsThe list of VariableDocs for operations |
qualifiersList of (key_label, port) tuples. |
edgesList of edges used to represent this node's attributes. These should not be added to the DotGraph; this node will generate their dotfile code directly. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 3.0alpha2 on Tue Apr 11 17:34:42 2006 | http://epydoc.sf.net |