# eric4.Graphics.PackageDiagram

Module implementing a dialog showing a UML like class diagram of a package.

### Global Attributes

None

### Classes

PackageDiagram | Class implementing a dialog showing a UML like class diagram of a package.

### Functions

None

## PackageDiagram

Class implementing a dialog showing a UML like class diagram of a package.

### Derived from

UMLDialog

### Class Attributes

None

### Methods

PackageDiagram | Constructor
__addExternalClass | Private method to add a class defined outside the module.
__addLocalClass | Private method to add a class defined in the module.
__arrangeClasses | Private method to arrange the shapes on the canvas.
__buildClasses | Private method to build the class shapes of the package diagram.
__buildModulesDict | Private method to build a dictionary of modules contained in the package.
__createAssociations | Private method to generate the associations between the class shapes.
__getCurrentShape | Private method to get the named shape.
relayout | Method to relayout the diagram.
show | Overriden method to show the dialog.

#### PackageDiagram (Constructor)

PackageDiagram(package, parent = None, name = None, noAttrs = False)

Constructor

package
  name of a python package to be shown (string)
parent
  parent widget of the view (QWidget)
name
  name of the view widget (QString or string)
noAttrs=
  flag indicating, that no attributes should be shown (boolean)

#### PackageDiagram.__addExternalClass

__addExternalClass(_class, x, y)

Private method to add a class defined outside the module.

If the canvas is too small to take the shape, it is enlarged.

_class
  class to be shown (string)
x
  x-coordinate (float)
y
  y-coordinate (float)

#### PackageDiagram.__addLocalClass

__addLocalClass(className, _class, x, y, isRbModule = False)

Private method to add a class defined in the module.

className
  name of the class to be as a dictionary key (string)
_class
  class to be shown (ModuleParser.Class)
x
  x-coordinate (float)
y
  y-coordinate (float)
isRbModule
  flag indicating a Ruby module (boolean)

#### PackageDiagram.__arrangeClasses

__arrangeClasses(nodes, routes, whiteSpaceFactor = 1.2)

Private method to arrange the shapes on the canvas.

The algorithm is borrowed from Boa Constructor.

#### PackageDiagram.__buildClasses

__buildClasses()

Private method to build the class shapes of the package diagram.

The algorithm is borrowed from Boa Constructor.

#### PackageDiagram.__buildModulesDict

__buildModulesDict()

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

Returns:
  dictionary of modules contained in the package.

#### PackageDiagram.__createAssociations

__createAssociations(routes)

Private method to generate the associations between the class shapes.

routes
  list of relationsships

#### PackageDiagram.__getCurrentShape

__getCurrentShape(name)

Private method to get the named shape.

name
  name of the shape (string)

Returns:
  shape (QCanvasItem)

#### PackageDiagram.relayout

relayout()

Method to relayout the diagram.

#### PackageDiagram.show

show()

Overriden method to show the dialog.

Up