4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing the UMLItem base class. |
7 Module implementing the UMLItem base class. |
8 """ |
8 """ |
|
9 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
9 |
11 |
10 from PyQt4.QtCore import Qt, QSizeF |
12 from PyQt4.QtCore import Qt, QSizeF |
11 from PyQt4.QtGui import QGraphicsItem, QGraphicsRectItem, QStyle |
13 from PyQt4.QtGui import QGraphicsItem, QGraphicsRectItem, QStyle |
12 |
14 |
13 import Preferences |
15 import Preferences |
48 @param x x-coordinate (integer) |
50 @param x x-coordinate (integer) |
49 @param y y-coordinate (integer) |
51 @param y y-coordinate (integer) |
50 @param rounded flag indicating a rounded corner (boolean) |
52 @param rounded flag indicating a rounded corner (boolean) |
51 @keyparam parent reference to the parent object (QGraphicsItem) |
53 @keyparam parent reference to the parent object (QGraphicsItem) |
52 """ |
54 """ |
53 super().__init__(parent) |
55 super(UMLItem, self).__init__(parent) |
54 self.model = model |
56 self.model = model |
55 |
57 |
56 self.font = Preferences.getGraphics("Font") |
58 self.font = Preferences.getGraphics("Font") |
57 self.margin = 5 |
59 self.margin = 5 |
58 self.associations = [] |
60 self.associations = [] |
137 Overriden method to move the widget relative. |
139 Overriden method to move the widget relative. |
138 |
140 |
139 @param dx relative movement in x-direction (float) |
141 @param dx relative movement in x-direction (float) |
140 @param dy relative movement in y-direction (float) |
142 @param dy relative movement in y-direction (float) |
141 """ |
143 """ |
142 super().moveBy(dx, dy) |
144 super(UMLItem, self).moveBy(dx, dy) |
143 self.adjustAssociations() |
145 self.adjustAssociations() |
144 |
146 |
145 def setPos(self, x, y): |
147 def setPos(self, x, y): |
146 """ |
148 """ |
147 Overriden method to set the items position. |
149 Overriden method to set the items position. |
148 |
150 |
149 @param x absolute x-position (float) |
151 @param x absolute x-position (float) |
150 @param y absolute y-position (float) |
152 @param y absolute y-position (float) |
151 """ |
153 """ |
152 super().setPos(x, y) |
154 super(UMLItem, self).setPos(x, y) |
153 self.adjustAssociations() |
155 self.adjustAssociations() |
154 |
156 |
155 def itemChange(self, change, value): |
157 def itemChange(self, change, value): |
156 """ |
158 """ |
157 Protected method called when an items state changes. |
159 Protected method called when an items state changes. |