Graphics/ModuleItem.py

changeset 945
8cd4d08fa9f6
parent 791
9ec2ac20e54e
child 1112
8a7d1b9d18db
equal deleted inserted replaced
944:1b59c4ba121e 945:8cd4d08fa9f6
9 9
10 from PyQt4.QtCore import * 10 from PyQt4.QtCore import *
11 from PyQt4.QtGui import * 11 from PyQt4.QtGui import *
12 12
13 from .UMLItem import UMLItem 13 from .UMLItem import UMLItem
14
14 15
15 class ModuleModel(object): 16 class ModuleModel(object):
16 """ 17 """
17 Class implementing the module model. 18 Class implementing the module model.
18 """ 19 """
48 49
49 @return module name (string) 50 @return module name (string)
50 """ 51 """
51 return self.name 52 return self.name
52 53
54
53 class ModuleItem(UMLItem): 55 class ModuleItem(UMLItem):
54 """ 56 """
55 Class implementing a module item. 57 Class implementing a module item.
56 """ 58 """
57 def __init__(self, model = None, x = 0, y = 0, rounded = False, 59 def __init__(self, model=None, x=0, y=0, rounded=False,
58 parent = None, scene = None): 60 parent=None, scene=None):
59 """ 61 """
60 Constructor 62 Constructor
61 63
62 @param model module model containing the module data (ModuleModel) 64 @param model module model containing the module data (ModuleModel)
63 @param x x-coordinate (integer) 65 @param x x-coordinate (integer)
130 self.meths = None 132 self.meths = None
131 self.model = model 133 self.model = model
132 self.__createTexts() 134 self.__createTexts()
133 self.__calculateSize() 135 self.__calculateSize()
134 136
135 def paint(self, painter, option, widget = None): 137 def paint(self, painter, option, widget=None):
136 """ 138 """
137 Public method to paint the item in local coordinates. 139 Public method to paint the item in local coordinates.
138 140
139 @param painter reference to the painter object (QPainter) 141 @param painter reference to the painter object (QPainter)
140 @param option style options (QStyleOptionGraphicsItem) 142 @param option style options (QStyleOptionGraphicsItem)

eric ide

mercurial