|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Graphics.UMLItem</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.Graphics.UMLItem</h1> |
|
23 <p> |
|
24 Module implementing the UMLItem base class. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#UMLItem">UMLItem</a></td> |
|
34 <td>Class implementing the UMLItem base class.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#UMLModel">UMLModel</a></td> |
|
37 <td>Class implementing the UMLModel base class.</td> |
|
38 </tr> |
|
39 </table> |
|
40 <h3>Functions</h3> |
|
41 <table> |
|
42 <tr><td>None</td></tr> |
|
43 </table> |
|
44 <hr /><hr /> |
|
45 <a NAME="UMLItem" ID="UMLItem"></a> |
|
46 <h2>UMLItem</h2> |
|
47 <p> |
|
48 Class implementing the UMLItem base class. |
|
49 </p> |
|
50 <h3>Derived from</h3> |
|
51 QGraphicsRectItem |
|
52 <h3>Class Attributes</h3> |
|
53 <table> |
|
54 <tr><td>ItemType</td></tr> |
|
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 <table> |
|
58 <tr><td>None</td></tr> |
|
59 </table> |
|
60 <h3>Methods</h3> |
|
61 <table> |
|
62 <tr> |
|
63 <td><a href="#UMLItem.__init__">UMLItem</a></td> |
|
64 <td>Constructor</td> |
|
65 </tr><tr> |
|
66 <td><a href="#UMLItem.addAssociation">addAssociation</a></td> |
|
67 <td>Public method to add an association to this widget.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#UMLItem.adjustAssociations">adjustAssociations</a></td> |
|
70 <td>Public method to adjust the associations to widget movements.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#UMLItem.buildItemDataString">buildItemDataString</a></td> |
|
73 <td>Public method to build a string to persist the specific item data.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#UMLItem.getId">getId</a></td> |
|
76 <td>Public method to get the item ID.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#UMLItem.getItemType">getItemType</a></td> |
|
79 <td>Public method to get the item's type.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#UMLItem.getName">getName</a></td> |
|
82 <td>Public method to retrieve the item name.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#UMLItem.itemChange">itemChange</a></td> |
|
85 <td>Public method called when an items state changes.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#UMLItem.moveBy">moveBy</a></td> |
|
88 <td>Public overriden method to move the widget relative.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#UMLItem.paint">paint</a></td> |
|
91 <td>Public method to paint the item in local coordinates.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#UMLItem.parseItemDataString">parseItemDataString</a></td> |
|
94 <td>Public method to parse the given persistence data.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#UMLItem.removeAssociation">removeAssociation</a></td> |
|
97 <td>Public method to remove an association to this widget.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#UMLItem.removeAssociations">removeAssociations</a></td> |
|
100 <td>Public method to remove all associations of this widget.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#UMLItem.setId">setId</a></td> |
|
103 <td>Public method to assign an ID to the item.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#UMLItem.setPos">setPos</a></td> |
|
106 <td>Public overriden method to set the items position.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#UMLItem.setSize">setSize</a></td> |
|
109 <td>Public method to set the rectangles size.</td> |
|
110 </tr> |
|
111 </table> |
|
112 <h3>Static Methods</h3> |
|
113 <table> |
|
114 <tr><td>None</td></tr> |
|
115 </table> |
|
116 <a NAME="UMLItem.__init__" ID="UMLItem.__init__"></a> |
|
117 <h4>UMLItem (Constructor)</h4> |
|
118 <b>UMLItem</b>(<i>model=None, x=0, y=0, rounded=False, parent=None</i>) |
|
119 <p> |
|
120 Constructor |
|
121 </p><dl> |
|
122 <dt><i>model</i></dt> |
|
123 <dd> |
|
124 UML model containing the item data (UMLModel) |
|
125 </dd><dt><i>x</i></dt> |
|
126 <dd> |
|
127 x-coordinate (integer) |
|
128 </dd><dt><i>y</i></dt> |
|
129 <dd> |
|
130 y-coordinate (integer) |
|
131 </dd><dt><i>rounded</i></dt> |
|
132 <dd> |
|
133 flag indicating a rounded corner (boolean) |
|
134 </dd><dt><i>parent=</i></dt> |
|
135 <dd> |
|
136 reference to the parent object (QGraphicsItem) |
|
137 </dd> |
|
138 </dl><a NAME="UMLItem.addAssociation" ID="UMLItem.addAssociation"></a> |
|
139 <h4>UMLItem.addAssociation</h4> |
|
140 <b>addAssociation</b>(<i>assoc</i>) |
|
141 <p> |
|
142 Public method to add an association to this widget. |
|
143 </p><dl> |
|
144 <dt><i>assoc</i></dt> |
|
145 <dd> |
|
146 association to be added (AssociationWidget) |
|
147 </dd> |
|
148 </dl><a NAME="UMLItem.adjustAssociations" ID="UMLItem.adjustAssociations"></a> |
|
149 <h4>UMLItem.adjustAssociations</h4> |
|
150 <b>adjustAssociations</b>(<i></i>) |
|
151 <p> |
|
152 Public method to adjust the associations to widget movements. |
|
153 </p><a NAME="UMLItem.buildItemDataString" ID="UMLItem.buildItemDataString"></a> |
|
154 <h4>UMLItem.buildItemDataString</h4> |
|
155 <b>buildItemDataString</b>(<i></i>) |
|
156 <p> |
|
157 Public method to build a string to persist the specific item data. |
|
158 </p><p> |
|
159 This string must start with ", " and should be built like |
|
160 "attribute=value" with pairs separated by ", ". value must not |
|
161 contain ", " or newlines. |
|
162 </p><dl> |
|
163 <dt>Returns:</dt> |
|
164 <dd> |
|
165 persistence data (string) |
|
166 </dd> |
|
167 </dl><a NAME="UMLItem.getId" ID="UMLItem.getId"></a> |
|
168 <h4>UMLItem.getId</h4> |
|
169 <b>getId</b>(<i></i>) |
|
170 <p> |
|
171 Public method to get the item ID. |
|
172 </p><dl> |
|
173 <dt>Returns:</dt> |
|
174 <dd> |
|
175 ID of the item (integer) |
|
176 </dd> |
|
177 </dl><a NAME="UMLItem.getItemType" ID="UMLItem.getItemType"></a> |
|
178 <h4>UMLItem.getItemType</h4> |
|
179 <b>getItemType</b>(<i></i>) |
|
180 <p> |
|
181 Public method to get the item's type. |
|
182 </p><dl> |
|
183 <dt>Returns:</dt> |
|
184 <dd> |
|
185 item type (string) |
|
186 </dd> |
|
187 </dl><a NAME="UMLItem.getName" ID="UMLItem.getName"></a> |
|
188 <h4>UMLItem.getName</h4> |
|
189 <b>getName</b>(<i></i>) |
|
190 <p> |
|
191 Public method to retrieve the item name. |
|
192 </p><dl> |
|
193 <dt>Returns:</dt> |
|
194 <dd> |
|
195 item name (string) |
|
196 </dd> |
|
197 </dl><a NAME="UMLItem.itemChange" ID="UMLItem.itemChange"></a> |
|
198 <h4>UMLItem.itemChange</h4> |
|
199 <b>itemChange</b>(<i>change, value</i>) |
|
200 <p> |
|
201 Public method called when an items state changes. |
|
202 </p><dl> |
|
203 <dt><i>change</i></dt> |
|
204 <dd> |
|
205 the item's change (QGraphicsItem.GraphicsItemChange) |
|
206 </dd><dt><i>value</i></dt> |
|
207 <dd> |
|
208 the value of the change |
|
209 </dd> |
|
210 </dl><dl> |
|
211 <dt>Returns:</dt> |
|
212 <dd> |
|
213 adjusted values |
|
214 </dd> |
|
215 </dl><a NAME="UMLItem.moveBy" ID="UMLItem.moveBy"></a> |
|
216 <h4>UMLItem.moveBy</h4> |
|
217 <b>moveBy</b>(<i>dx, dy</i>) |
|
218 <p> |
|
219 Public overriden method to move the widget relative. |
|
220 </p><dl> |
|
221 <dt><i>dx</i></dt> |
|
222 <dd> |
|
223 relative movement in x-direction (float) |
|
224 </dd><dt><i>dy</i></dt> |
|
225 <dd> |
|
226 relative movement in y-direction (float) |
|
227 </dd> |
|
228 </dl><a NAME="UMLItem.paint" ID="UMLItem.paint"></a> |
|
229 <h4>UMLItem.paint</h4> |
|
230 <b>paint</b>(<i>painter, option, widget=None</i>) |
|
231 <p> |
|
232 Public method to paint the item in local coordinates. |
|
233 </p><dl> |
|
234 <dt><i>painter</i></dt> |
|
235 <dd> |
|
236 reference to the painter object (QPainter) |
|
237 </dd><dt><i>option</i></dt> |
|
238 <dd> |
|
239 style options (QStyleOptionGraphicsItem) |
|
240 </dd><dt><i>widget</i></dt> |
|
241 <dd> |
|
242 optional reference to the widget painted on (QWidget) |
|
243 </dd> |
|
244 </dl><a NAME="UMLItem.parseItemDataString" ID="UMLItem.parseItemDataString"></a> |
|
245 <h4>UMLItem.parseItemDataString</h4> |
|
246 <b>parseItemDataString</b>(<i>version, data</i>) |
|
247 <p> |
|
248 Public method to parse the given persistence data. |
|
249 </p><dl> |
|
250 <dt><i>version</i></dt> |
|
251 <dd> |
|
252 version of the data (string) |
|
253 </dd><dt><i>data</i></dt> |
|
254 <dd> |
|
255 persisted data to be parsed (string) |
|
256 </dd> |
|
257 </dl><dl> |
|
258 <dt>Returns:</dt> |
|
259 <dd> |
|
260 flag indicating success (boolean) |
|
261 </dd> |
|
262 </dl><a NAME="UMLItem.removeAssociation" ID="UMLItem.removeAssociation"></a> |
|
263 <h4>UMLItem.removeAssociation</h4> |
|
264 <b>removeAssociation</b>(<i>assoc</i>) |
|
265 <p> |
|
266 Public method to remove an association to this widget. |
|
267 </p><dl> |
|
268 <dt><i>assoc</i></dt> |
|
269 <dd> |
|
270 association to be removed (AssociationWidget) |
|
271 </dd> |
|
272 </dl><a NAME="UMLItem.removeAssociations" ID="UMLItem.removeAssociations"></a> |
|
273 <h4>UMLItem.removeAssociations</h4> |
|
274 <b>removeAssociations</b>(<i></i>) |
|
275 <p> |
|
276 Public method to remove all associations of this widget. |
|
277 </p><a NAME="UMLItem.setId" ID="UMLItem.setId"></a> |
|
278 <h4>UMLItem.setId</h4> |
|
279 <b>setId</b>(<i>itemId</i>) |
|
280 <p> |
|
281 Public method to assign an ID to the item. |
|
282 </p><dl> |
|
283 <dt><i>itemId</i></dt> |
|
284 <dd> |
|
285 assigned ID (integer) |
|
286 </dd> |
|
287 </dl><a NAME="UMLItem.setPos" ID="UMLItem.setPos"></a> |
|
288 <h4>UMLItem.setPos</h4> |
|
289 <b>setPos</b>(<i>x, y</i>) |
|
290 <p> |
|
291 Public overriden method to set the items position. |
|
292 </p><dl> |
|
293 <dt><i>x</i></dt> |
|
294 <dd> |
|
295 absolute x-position (float) |
|
296 </dd><dt><i>y</i></dt> |
|
297 <dd> |
|
298 absolute y-position (float) |
|
299 </dd> |
|
300 </dl><a NAME="UMLItem.setSize" ID="UMLItem.setSize"></a> |
|
301 <h4>UMLItem.setSize</h4> |
|
302 <b>setSize</b>(<i>width, height</i>) |
|
303 <p> |
|
304 Public method to set the rectangles size. |
|
305 </p><dl> |
|
306 <dt><i>width</i></dt> |
|
307 <dd> |
|
308 width of the rectangle (float) |
|
309 </dd><dt><i>height</i></dt> |
|
310 <dd> |
|
311 height of the rectangle (float) |
|
312 </dd> |
|
313 </dl> |
|
314 <div align="right"><a href="#top">Up</a></div> |
|
315 <hr /><hr /> |
|
316 <a NAME="UMLModel" ID="UMLModel"></a> |
|
317 <h2>UMLModel</h2> |
|
318 <p> |
|
319 Class implementing the UMLModel base class. |
|
320 </p> |
|
321 <h3>Derived from</h3> |
|
322 object |
|
323 <h3>Class Attributes</h3> |
|
324 <table> |
|
325 <tr><td>None</td></tr> |
|
326 </table> |
|
327 <h3>Class Methods</h3> |
|
328 <table> |
|
329 <tr><td>None</td></tr> |
|
330 </table> |
|
331 <h3>Methods</h3> |
|
332 <table> |
|
333 <tr> |
|
334 <td><a href="#UMLModel.__init__">UMLModel</a></td> |
|
335 <td>Constructor</td> |
|
336 </tr><tr> |
|
337 <td><a href="#UMLModel.getName">getName</a></td> |
|
338 <td>Public method to retrieve the model name.</td> |
|
339 </tr> |
|
340 </table> |
|
341 <h3>Static Methods</h3> |
|
342 <table> |
|
343 <tr><td>None</td></tr> |
|
344 </table> |
|
345 <a NAME="UMLModel.__init__" ID="UMLModel.__init__"></a> |
|
346 <h4>UMLModel (Constructor)</h4> |
|
347 <b>UMLModel</b>(<i>name</i>) |
|
348 <p> |
|
349 Constructor |
|
350 </p><dl> |
|
351 <dt><i>name</i></dt> |
|
352 <dd> |
|
353 package name (string) |
|
354 </dd> |
|
355 </dl><a NAME="UMLModel.getName" ID="UMLModel.getName"></a> |
|
356 <h4>UMLModel.getName</h4> |
|
357 <b>getName</b>(<i></i>) |
|
358 <p> |
|
359 Public method to retrieve the model name. |
|
360 </p><dl> |
|
361 <dt>Returns:</dt> |
|
362 <dd> |
|
363 model name (string) |
|
364 </dd> |
|
365 </dl> |
|
366 <div align="right"><a href="#top">Up</a></div> |
|
367 <hr /> |
|
368 </body></html> |