eric6/Graphics/AssociationItem.py

changeset 8268
6b8128e0c9d1
parent 8257
28146736bbfc
child 8270
6ba3564b7161
equal deleted inserted replaced
8267:6baca884c73a 8268:6b8128e0c9d1
8 """ 8 """
9 9
10 from PyQt5.QtCore import QPointF, QRectF, QLineF 10 from PyQt5.QtCore import QPointF, QRectF, QLineF
11 from PyQt5.QtWidgets import QGraphicsItem 11 from PyQt5.QtWidgets import QGraphicsItem
12 12
13 from E5Graphics.E5ArrowItem import E5ArrowItem, NormalArrow, WideArrow 13 from E5Graphics.E5ArrowItem import E5ArrowItem, E5ArrowType
14 14
15 import Utilities 15 import Utilities
16 16
17 17
18 # TODO: convert to Enum
18 Normal = 0 19 Normal = 0
19 Generalisation = 1 20 Generalisation = 1
20 Imports = 2 21 Imports = 2
21 22
22 23 # TODO: convert to Enum
23 NoRegion = 0 24 NoRegion = 0
24 West = 1 25 West = 1
25 North = 2 26 North = 2
26 East = 3 27 East = 3
27 South = 4 28 South = 4
59 @type tuple of (QColor, QColor) 60 @type tuple of (QColor, QColor)
60 @param parent reference to the parent object 61 @param parent reference to the parent object
61 @type QGraphicsItem 62 @type QGraphicsItem
62 """ 63 """
63 if assocType in (Normal, Imports): 64 if assocType in (Normal, Imports):
64 arrowType = NormalArrow 65 arrowType = E5ArrowType.NORMAL
65 arrowFilled = True 66 arrowFilled = True
66 elif assocType == Generalisation: 67 elif assocType == Generalisation:
67 arrowType = WideArrow 68 arrowType = E5ArrowType.WIDE
68 arrowFilled = False 69 arrowFilled = False
69 70
70 E5ArrowItem.__init__(self, QPointF(0, 0), QPointF(100, 100), 71 E5ArrowItem.__init__(self, QPointF(0, 0), QPointF(100, 100),
71 arrowFilled, arrowType, colors, parent) 72 arrowFilled, arrowType, colors, parent)
72 73

eric ide

mercurial