eric3.Graphics.PackageDiagram

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

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

QDialog

Methods

PackageDiagram Constructor
__tr Private method to translate the display strings.
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.
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.
getDiagramName Method to retrieve a name for the diagram.
languageChange Private method used to show the localized strings for this dialog.
relayout Method to relayout the diagram.
show Overriden method to show the dialog.

PackageDiagram (Constructor)

PackageDiagram(package, parent = None, name = None, modal = 0, fl = 0, noAttrs=0)

Constructor

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

PackageDiagram.__tr

__tr(s, c = None)

Private method to translate the display strings.

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 (integer)
y
y-coordinate (integer)

PackageDiagram.addLocalClass

addLocalClass(className, _class, x, y, isRbModule=0)

Private method to add a class defined in the module. If the canvas is too small to take the shape, it is enlarged.

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

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 class 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.getDiagramName

getDiagramName()

Method to retrieve a name for the diagram.

Returns:
name for the diagram

PackageDiagram.languageChange

languageChange()

Private method used to show the localized strings for this dialog.

PackageDiagram.relayout

relayout()

Method to relayout the diagram.

PackageDiagram.show

show()

Overriden method to show the dialog.

Up