eric7.Graphics.ImportsDiagramBuilder

Module implementing a dialog showing an imports diagram of a package.

Global Attributes

None

Classes

ImportsDiagramBuilder Class implementing a builder for imports diagrams of a package.

Functions

None


ImportsDiagramBuilder

Class implementing a builder for imports diagrams of a package.

Note: Only package internal imports are shown in order to maintain some readability.

Derived from

UMLDiagramBuilder

Class Attributes

None

Class Methods

None

Methods

ImportsDiagramBuilder Constructor
__addModule Private method to add a module to the diagram.
__arrangeNodes Private method to arrange the shapes on the canvas.
__buildModulesDict Private method to build a dictionary of modules contained in the package.
__createAssociations Private method to generate the associations between the module shapes.
buildDiagram Public method to build the modules shapes of the diagram.
fromDict
initialize Public method to initialize the object.
parsePersistenceData
toDict Public method to collect data to be persisted.

Static Methods

None

ImportsDiagramBuilder (Constructor)

ImportsDiagramBuilder(dialog, view, project, package, showExternalImports=False)

Constructor

dialog (UMLDialog)
reference to the UML dialog
view (UMLGraphicsView)
reference to the view object
project (Project)
reference to the project object
package (str)
name of a python package to show the import relationships
showExternalImports (bool)
flag indicating to show exports from outside the package

ImportsDiagramBuilder.__addModule

__addModule(name, classes, x, y)

Private method to add a module to the diagram.

name (str)
module name to be shown
classes (list of str)
list of class names contained in the module
x (float)
x-coordinate
y (float)
y-coordinate
Return:
reference to the imports item
Return Type:
ModuleItem

ImportsDiagramBuilder.__arrangeNodes

__arrangeNodes(nodes, routes, whiteSpaceFactor=1.2)

Private method to arrange the shapes on the canvas.

The algorithm is borrowed from Boa Constructor.

nodes (list of str)
list of nodes to arrange
routes (list of tuple of (str, str))
list of routes
whiteSpaceFactor (float)
factor to increase whitespace between items

ImportsDiagramBuilder.__buildModulesDict

__buildModulesDict()

Private method to build a dictionary of modules contained in the package.

Return:
dictionary of modules contained in the package
Return Type:
dict

ImportsDiagramBuilder.__createAssociations

__createAssociations(routes)

Private method to generate the associations between the module shapes.

routes (list of tuple of (str, str))
list of associations

ImportsDiagramBuilder.buildDiagram

buildDiagram()

Public method to build the modules shapes of the diagram.

ImportsDiagramBuilder.fromDict

fromDict(version, data)

ImportsDiagramBuilder.initialize

initialize()

Public method to initialize the object.

ImportsDiagramBuilder.parsePersistenceData

parsePersistenceData(version, data)

ImportsDiagramBuilder.toDict

toDict()

Public method to collect data to be persisted.

Return:
dictionary containing data to be persisted
Return Type:
dict
Up