# eric6.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.
__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.
getPersistenceData | Public method to get a string for data to be persisted.
initialize | Public method to initialize the object.
parsePersistenceData | Public method to parse persisted data.

### Static Methods

None

#### ImportsDiagramBuilder (Constructor)

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

Constructor

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

#### ImportsDiagramBuilder.__addModule

__addModule(name, classes, x, y)

Private method to add a module to the diagram.

name
  module name to be shown (string)
classes
  list of class names contained in the module (list of strings)
x
  x-coordinate (float)
y
  y-coordinate (float)

Returns:
  reference to the imports item (ModuleItem)

#### ImportsDiagramBuilder.__buildModulesDict

__buildModulesDict()

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

Returns:
  dictionary of modules contained in the package.

#### ImportsDiagramBuilder.__createAssociations

__createAssociations(shapes)

Private method to generate the associations between the module shapes.

shapes
  list of shapes

#### ImportsDiagramBuilder.buildDiagram

buildDiagram()

Public method to build the modules shapes of the diagram.

#### ImportsDiagramBuilder.getPersistenceData

getPersistenceData()

Public method to get a string for data to be persisted.

Returns:
  persisted data string (string)

#### ImportsDiagramBuilder.initialize

initialize()

Public method to initialize the object.

#### ImportsDiagramBuilder.parsePersistenceData

parsePersistenceData(version, data)

Public method to parse persisted data.

version
  version of the data (string)
data
  persisted data to be parsed (string)

Returns:
  flag indicating success (boolean)

Up