# eric4.Graphics.ModuleItem

Module implementing a module item.

### Global Attributes

None

### Classes

ModuleItem | Class implementing a module item.
ModuleModel | Class implementing the module model.

### Functions

None

## ModuleItem

Class implementing a module item.

### Derived from

UMLItem

### Class Attributes

None

### Methods

ModuleItem | Constructor
__calculateSize | Private method to calculate the size of the module item.
__createTexts | Private method to create the text items of the module item.
paint | Public method to paint the item in local coordinates.
setModel | Method to set the module model.

#### ModuleItem (Constructor)

ModuleItem(model = None, x = 0, y = 0, rounded = False, parent = None, scene = None)

Constructor

model
  module model containing the module data (ModuleModel)
x
  x-coordinate (integer)
y
  y-coordinate (integer)
rounded=
  flag indicating a rounded corner (boolean)
parent=
  reference to the parent object (QGraphicsItem)
scene=
  reference to the scene object (QGraphicsScene)

#### ModuleItem.__calculateSize

__calculateSize()

Private method to calculate the size of the module item.

#### ModuleItem.__createTexts

__createTexts()

Private method to create the text items of the module item.

#### ModuleItem.paint

paint(painter, option, widget = None)

Public method to paint the item in local coordinates.

painter
  reference to the painter object (QPainter)
option
  style options (QStyleOptionGraphicsItem)
widget
  optional reference to the widget painted on (QWidget)

#### ModuleItem.setModel

setModel(model)

Method to set the module model.

model
  module model containing the module data (ModuleModel)

Up

## ModuleModel

Class implementing the module model.

### Derived from

object

### Class Attributes

None

### Methods

ModuleModel | Constructor
addClass | Method to add a class to the module model.
getClasses | Method to retrieve the classes of the module.
getName | Method to retrieve the module name.

#### ModuleModel (Constructor)

ModuleModel(name, classlist=[])

Constructor

name
  the module name (string)
classlist
  list of class names (list of strings)

#### ModuleModel.addClass

addClass(classname)

Method to add a class to the module model.

classname
  class name to be added (string)

#### ModuleModel.getClasses

getClasses()

Method to retrieve the classes of the module.

Returns:
  list of class names (list of strings)

#### ModuleModel.getName

getName()

Method to retrieve the module name.

Returns:
  module name (string)

Up