# eric4.Graphics.PackageItem

Module implementing a package item.

### Global Attributes

None

### Classes

PackageItem | Class implementing a package item.
PackageModel | Class implementing the package model.

### Functions

None

## PackageItem

Class implementing a package item.

### Derived from

UMLItem

### Class Attributes

None

### Class Methods

None

### Methods

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

### Static Methods

None

#### PackageItem (Constructor)

PackageItem(model = None, x = 0, y = 0, rounded = False, noModules = 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)
noModules=
  flag indicating, that no module names should be shown (boolean)
parent=
  reference to the parent object (QGraphicsItem)
scene=
  reference to the scene object (QGraphicsScene)

#### PackageItem.__calculateSize

__calculateSize()

Method to calculate the size of the package widget.

#### PackageItem.__createTexts

__createTexts()

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

#### PackageItem.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)

#### PackageItem.setModel

setModel(model)

Method to set the package model.

model
  package model containing the package data (PackageModel)

Up

## PackageModel

Class implementing the package model.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

PackageModel | Constructor
addModule | Method to add a module to the package model.
getModules | Method to retrieve the modules of the package.
getName | Method to retrieve the package name.

### Static Methods

None

#### PackageModel (Constructor)

PackageModel(name, moduleslist = [])

Constructor

name
  package name (string)
moduleslist
  list of module names (list of strings)

#### PackageModel.addModule

addModule(modulename)

Method to add a module to the package model.

modulename
  module name to be added (string)

#### PackageModel.getModules

getModules()

Method to retrieve the modules of the package.

Returns:
  list of module names (list of strings)

#### PackageModel.getName

getName()

Method to retrieve the package name.

Returns:
  package name (string)

Up