eric4.Graphics.UMLClassDiagram

Module implementing a dialog showing a UML like class diagram.

Global Attributes

None

Classes

UMLClassDiagram Class implementing a dialog showing a UML like class diagram.

Functions

None


UMLClassDiagram

Class implementing a dialog showing a UML like class diagram.

Derived from

UMLDialog

Class Attributes

None

Class Methods

None

Methods

UMLClassDiagram 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 class diagram.
__createAssociations Private method to generate the associations between the class shapes.
__getCurrentShape Private method to get the named shape.
relayout Public method to relayout the diagram.
show Overriden method to show the dialog.

Static Methods

None

UMLClassDiagram (Constructor)

UMLClassDiagram(file, parent = None, name = None, noAttrs = False)

Constructor

file
filename of a python module 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)

UMLClassDiagram.__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)

UMLClassDiagram.__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)

UMLClassDiagram.__arrangeClasses

__arrangeClasses(nodes, routes, whiteSpaceFactor = 1.2)

Private method to arrange the shapes on the canvas.

The algorithm is borrowed from Boa Constructor.

UMLClassDiagram.__buildClasses

__buildClasses()

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

The algorithm is borrowed from Boa Constructor.

UMLClassDiagram.__createAssociations

__createAssociations(routes)

Private method to generate the associations between the class shapes.

routes
list of relationsships

UMLClassDiagram.__getCurrentShape

__getCurrentShape(name)

Private method to get the named shape.

name
name of the shape (string)
Returns:
shape (QGraphicsItem)

UMLClassDiagram.relayout

relayout()

Public method to relayout the diagram.

UMLClassDiagram.show

show()

Overriden method to show the dialog.

Up