|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric4.Graphics.UMLItem</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.Graphics.UMLItem</h1> |
|
24 <p> |
|
25 Module implementing the UMLWidget base class. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#UMLItem">UMLItem</a></td> |
|
35 <td>Class implementing the UMLItem base class.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="UMLItem" ID="UMLItem"></a> |
|
44 <h2>UMLItem</h2> |
|
45 <p> |
|
46 Class implementing the UMLItem base class. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 QGraphicsRectItem |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>None</td></tr> |
|
53 </table> |
|
54 <h3>Methods</h3> |
|
55 <table> |
|
56 <tr> |
|
57 <td><a href="#UMLItem.__init__">UMLItem</a></td> |
|
58 <td>Constructor</td> |
|
59 </tr><tr> |
|
60 <td><a href="#UMLItem.addAssociation">addAssociation</a></td> |
|
61 <td>Method to add an association to this widget.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#UMLItem.adjustAssociations">adjustAssociations</a></td> |
|
64 <td>Method to adjust the associations to widget movements.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#UMLItem.itemChange">itemChange</a></td> |
|
67 <td>Protected method called when an items state changes.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#UMLItem.moveBy">moveBy</a></td> |
|
70 <td>Overriden method to move the widget relative.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#UMLItem.paint">paint</a></td> |
|
73 <td>Public method to paint the item in local coordinates.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#UMLItem.removeAssociation">removeAssociation</a></td> |
|
76 <td>Method to remove an association to this widget.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#UMLItem.removeAssociations">removeAssociations</a></td> |
|
79 <td>Method to remove all associations of this widget.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#UMLItem.setPos">setPos</a></td> |
|
82 <td>Overriden method to set the items position.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#UMLItem.setSize">setSize</a></td> |
|
85 <td>Public method to set the rectangles size.</td> |
|
86 </tr> |
|
87 </table> |
|
88 <a NAME="UMLItem.__init__" ID="UMLItem.__init__"></a> |
|
89 <h4>UMLItem (Constructor)</h4> |
|
90 <b>UMLItem</b>(<i>x = 0, y = 0, rounded = False, parent = None</i>) |
|
91 <p> |
|
92 Constructor |
|
93 </p><dl> |
|
94 <dt><i>x</i></dt> |
|
95 <dd> |
|
96 x-coordinate (integer) |
|
97 </dd><dt><i>y</i></dt> |
|
98 <dd> |
|
99 y-coordinate (integer) |
|
100 </dd><dt><i>rounded</i></dt> |
|
101 <dd> |
|
102 flag indicating a rounded corner (boolean) |
|
103 </dd><dt><i>parent=</i></dt> |
|
104 <dd> |
|
105 reference to the parent object (QGraphicsItem) |
|
106 </dd> |
|
107 </dl><a NAME="UMLItem.addAssociation" ID="UMLItem.addAssociation"></a> |
|
108 <h4>UMLItem.addAssociation</h4> |
|
109 <b>addAssociation</b>(<i>assoc</i>) |
|
110 <p> |
|
111 Method to add an association to this widget. |
|
112 </p><dl> |
|
113 <dt><i>assoc</i></dt> |
|
114 <dd> |
|
115 association to be added (AssociationWidget) |
|
116 </dd> |
|
117 </dl><a NAME="UMLItem.adjustAssociations" ID="UMLItem.adjustAssociations"></a> |
|
118 <h4>UMLItem.adjustAssociations</h4> |
|
119 <b>adjustAssociations</b>(<i></i>) |
|
120 <p> |
|
121 Method to adjust the associations to widget movements. |
|
122 </p><a NAME="UMLItem.itemChange" ID="UMLItem.itemChange"></a> |
|
123 <h4>UMLItem.itemChange</h4> |
|
124 <b>itemChange</b>(<i>change, value</i>) |
|
125 <p> |
|
126 Protected method called when an items state changes. |
|
127 </p><dl> |
|
128 <dt><i>change</i></dt> |
|
129 <dd> |
|
130 the item's change (QGraphicsItem.GraphicsItemChange) |
|
131 </dd><dt><i>value</i></dt> |
|
132 <dd> |
|
133 the value of the change (QVariant) |
|
134 </dd> |
|
135 </dl><dl> |
|
136 <dt>Returns:</dt> |
|
137 <dd> |
|
138 adjusted values (QVariant) |
|
139 </dd> |
|
140 </dl><a NAME="UMLItem.moveBy" ID="UMLItem.moveBy"></a> |
|
141 <h4>UMLItem.moveBy</h4> |
|
142 <b>moveBy</b>(<i>dx, dy</i>) |
|
143 <p> |
|
144 Overriden method to move the widget relative. |
|
145 </p><dl> |
|
146 <dt><i>dx</i></dt> |
|
147 <dd> |
|
148 relative movement in x-direction (float) |
|
149 </dd><dt><i>dy</i></dt> |
|
150 <dd> |
|
151 relative movement in y-direction (float) |
|
152 </dd> |
|
153 </dl><a NAME="UMLItem.paint" ID="UMLItem.paint"></a> |
|
154 <h4>UMLItem.paint</h4> |
|
155 <b>paint</b>(<i>painter, option, widget = None</i>) |
|
156 <p> |
|
157 Public method to paint the item in local coordinates. |
|
158 </p><dl> |
|
159 <dt><i>painter</i></dt> |
|
160 <dd> |
|
161 reference to the painter object (QPainter) |
|
162 </dd><dt><i>option</i></dt> |
|
163 <dd> |
|
164 style options (QStyleOptionGraphicsItem) |
|
165 </dd><dt><i>widget</i></dt> |
|
166 <dd> |
|
167 optional reference to the widget painted on (QWidget) |
|
168 </dd> |
|
169 </dl><a NAME="UMLItem.removeAssociation" ID="UMLItem.removeAssociation"></a> |
|
170 <h4>UMLItem.removeAssociation</h4> |
|
171 <b>removeAssociation</b>(<i>assoc</i>) |
|
172 <p> |
|
173 Method to remove an association to this widget. |
|
174 </p><dl> |
|
175 <dt><i>assoc</i></dt> |
|
176 <dd> |
|
177 association to be removed (AssociationWidget) |
|
178 </dd> |
|
179 </dl><a NAME="UMLItem.removeAssociations" ID="UMLItem.removeAssociations"></a> |
|
180 <h4>UMLItem.removeAssociations</h4> |
|
181 <b>removeAssociations</b>(<i></i>) |
|
182 <p> |
|
183 Method to remove all associations of this widget. |
|
184 </p><a NAME="UMLItem.setPos" ID="UMLItem.setPos"></a> |
|
185 <h4>UMLItem.setPos</h4> |
|
186 <b>setPos</b>(<i>x, y</i>) |
|
187 <p> |
|
188 Overriden method to set the items position. |
|
189 </p><dl> |
|
190 <dt><i>x</i></dt> |
|
191 <dd> |
|
192 absolute x-position (float) |
|
193 </dd><dt><i>y</i></dt> |
|
194 <dd> |
|
195 absolute y-position (float) |
|
196 </dd> |
|
197 </dl><a NAME="UMLItem.setSize" ID="UMLItem.setSize"></a> |
|
198 <h4>UMLItem.setSize</h4> |
|
199 <b>setSize</b>(<i>width, height</i>) |
|
200 <p> |
|
201 Public method to set the rectangles size. |
|
202 </p><dl> |
|
203 <dt><i>width</i></dt> |
|
204 <dd> |
|
205 width of the rectangle (float) |
|
206 </dd><dt><i>height</i></dt> |
|
207 <dd> |
|
208 height of the rectangle (float) |
|
209 </dd> |
|
210 </dl> |
|
211 <div align="right"><a href="#top">Up</a></div> |
|
212 <hr /> |
|
213 </body></html> |