eric6/Documentation/Source/eric6.Graphics.ClassItem.html

changeset 7273
391d6b7b1eff
parent 6942
2602857055c5
child 7530
9f4fac61e7c7
equal deleted inserted replaced
7272:1779dc278077 7273:391d6b7b1eff
16 16
17 a { color: #BA6D36; } 17 a { color: #BA6D36; }
18 18
19 </style> 19 </style>
20 </head> 20 </head>
21 <body><a NAME="top" ID="top"></a> 21 <body>
22 <a NAME="top" ID="top"></a>
22 <h1>eric6.Graphics.ClassItem</h1> 23 <h1>eric6.Graphics.ClassItem</h1>
24
23 <p> 25 <p>
24 Module implementing an UML like class item. 26 Module implementing an UML like class item.
25 </p> 27 </p>
26 <h3>Global Attributes</h3> 28 <h3>Global Attributes</h3>
29
27 <table> 30 <table>
28 <tr><td>None</td></tr> 31 <tr><td>None</td></tr>
29 </table> 32 </table>
30 <h3>Classes</h3> 33 <h3>Classes</h3>
31 <table> 34
35 <table>
36
32 <tr> 37 <tr>
33 <td><a href="#ClassItem">ClassItem</a></td> 38 <td><a href="#ClassItem">ClassItem</a></td>
34 <td>Class implementing an UML like class item.</td> 39 <td>Class implementing an UML like class item.</td>
35 </tr><tr> 40 </tr>
41 <tr>
36 <td><a href="#ClassModel">ClassModel</a></td> 42 <td><a href="#ClassModel">ClassModel</a></td>
37 <td>Class implementing the class model.</td> 43 <td>Class implementing the class model.</td>
38 </tr> 44 </tr>
39 </table> 45 </table>
40 <h3>Functions</h3> 46 <h3>Functions</h3>
41 <table> 47
42 <tr><td>None</td></tr> 48 <table>
43 </table> 49 <tr><td>None</td></tr>
44 <hr /><hr /> 50 </table>
51 <hr />
52 <hr />
45 <a NAME="ClassItem" ID="ClassItem"></a> 53 <a NAME="ClassItem" ID="ClassItem"></a>
46 <h2>ClassItem</h2> 54 <h2>ClassItem</h2>
55
47 <p> 56 <p>
48 Class implementing an UML like class item. 57 Class implementing an UML like class item.
49 </p> 58 </p>
50 <h3>Derived from</h3> 59 <h3>Derived from</h3>
51 UMLItem 60 UMLItem
52 <h3>Class Attributes</h3> 61 <h3>Class Attributes</h3>
62
53 <table> 63 <table>
54 <tr><td>ItemType</td></tr> 64 <tr><td>ItemType</td></tr>
55 </table> 65 </table>
56 <h3>Class Methods</h3> 66 <h3>Class Methods</h3>
67
57 <table> 68 <table>
58 <tr><td>None</td></tr> 69 <tr><td>None</td></tr>
59 </table> 70 </table>
60 <h3>Methods</h3> 71 <h3>Methods</h3>
61 <table> 72
73 <table>
74
62 <tr> 75 <tr>
63 <td><a href="#ClassItem.__init__">ClassItem</a></td> 76 <td><a href="#ClassItem.__init__">ClassItem</a></td>
64 <td>Constructor</td> 77 <td>Constructor</td>
65 </tr><tr> 78 </tr>
79 <tr>
66 <td><a href="#ClassItem.__calculateSize">__calculateSize</a></td> 80 <td><a href="#ClassItem.__calculateSize">__calculateSize</a></td>
67 <td>Private method to calculate the size of the class item.</td> 81 <td>Private method to calculate the size of the class item.</td>
68 </tr><tr> 82 </tr>
83 <tr>
69 <td><a href="#ClassItem.__createTexts">__createTexts</a></td> 84 <td><a href="#ClassItem.__createTexts">__createTexts</a></td>
70 <td>Private method to create the text items of the class item.</td> 85 <td>Private method to create the text items of the class item.</td>
71 </tr><tr> 86 </tr>
87 <tr>
72 <td><a href="#ClassItem.buildItemDataString">buildItemDataString</a></td> 88 <td><a href="#ClassItem.buildItemDataString">buildItemDataString</a></td>
73 <td>Public method to build a string to persist the specific item data.</td> 89 <td>Public method to build a string to persist the specific item data.</td>
74 </tr><tr> 90 </tr>
91 <tr>
75 <td><a href="#ClassItem.isExternal">isExternal</a></td> 92 <td><a href="#ClassItem.isExternal">isExternal</a></td>
76 <td>Public method returning the external state.</td> 93 <td>Public method returning the external state.</td>
77 </tr><tr> 94 </tr>
95 <tr>
78 <td><a href="#ClassItem.paint">paint</a></td> 96 <td><a href="#ClassItem.paint">paint</a></td>
79 <td>Public method to paint the item in local coordinates.</td> 97 <td>Public method to paint the item in local coordinates.</td>
80 </tr><tr> 98 </tr>
99 <tr>
81 <td><a href="#ClassItem.parseItemDataString">parseItemDataString</a></td> 100 <td><a href="#ClassItem.parseItemDataString">parseItemDataString</a></td>
82 <td>Public method to parse the given persistence data.</td> 101 <td>Public method to parse the given persistence data.</td>
83 </tr><tr> 102 </tr>
103 <tr>
84 <td><a href="#ClassItem.setModel">setModel</a></td> 104 <td><a href="#ClassItem.setModel">setModel</a></td>
85 <td>Public method to set the class model.</td> 105 <td>Public method to set the class model.</td>
86 </tr> 106 </tr>
87 </table> 107 </table>
88 <h3>Static Methods</h3> 108 <h3>Static Methods</h3>
89 <table> 109
90 <tr><td>None</td></tr> 110 <table>
91 </table> 111 <tr><td>None</td></tr>
112 </table>
113
92 <a NAME="ClassItem.__init__" ID="ClassItem.__init__"></a> 114 <a NAME="ClassItem.__init__" ID="ClassItem.__init__"></a>
93 <h4>ClassItem (Constructor)</h4> 115 <h4>ClassItem (Constructor)</h4>
94 <b>ClassItem</b>(<i>model=None, external=False, x=0, y=0, rounded=False, noAttrs=False, parent=None, scene=None</i>) 116 <b>ClassItem</b>(<i>model=None, external=False, x=0, y=0, rounded=False, noAttrs=False, parent=None, scene=None</i>)
117
95 <p> 118 <p>
96 Constructor 119 Constructor
97 </p><dl> 120 </p>
121 <dl>
122
98 <dt><i>model</i></dt> 123 <dt><i>model</i></dt>
99 <dd> 124 <dd>
100 class model containing the class data (ClassModel) 125 class model containing the class data (ClassModel)
101 </dd><dt><i>external</i></dt> 126 </dd>
127 <dt><i>external</i></dt>
102 <dd> 128 <dd>
103 flag indicating a class defined outside our scope 129 flag indicating a class defined outside our scope
104 (boolean) 130 (boolean)
105 </dd><dt><i>x</i></dt> 131 </dd>
132 <dt><i>x</i></dt>
106 <dd> 133 <dd>
107 x-coordinate (integer) 134 x-coordinate (integer)
108 </dd><dt><i>y</i></dt> 135 </dd>
136 <dt><i>y</i></dt>
109 <dd> 137 <dd>
110 y-coordinate (integer) 138 y-coordinate (integer)
111 </dd><dt><i>rounded=</i></dt> 139 </dd>
140 <dt><i>rounded=</i></dt>
112 <dd> 141 <dd>
113 flag indicating a rounded corner (boolean) 142 flag indicating a rounded corner (boolean)
114 </dd><dt><i>noAttrs=</i></dt> 143 </dd>
144 <dt><i>noAttrs=</i></dt>
115 <dd> 145 <dd>
116 flag indicating, that no attributes should be shown 146 flag indicating, that no attributes should be shown
117 (boolean) 147 (boolean)
118 </dd><dt><i>parent=</i></dt> 148 </dd>
149 <dt><i>parent=</i></dt>
119 <dd> 150 <dd>
120 reference to the parent object (QGraphicsItem) 151 reference to the parent object (QGraphicsItem)
121 </dd><dt><i>scene=</i></dt> 152 </dd>
153 <dt><i>scene=</i></dt>
122 <dd> 154 <dd>
123 reference to the scene object (QGraphicsScene) 155 reference to the scene object (QGraphicsScene)
124 </dd> 156 </dd>
125 </dl><a NAME="ClassItem.__calculateSize" ID="ClassItem.__calculateSize"></a> 157 </dl>
158 <a NAME="ClassItem.__calculateSize" ID="ClassItem.__calculateSize"></a>
126 <h4>ClassItem.__calculateSize</h4> 159 <h4>ClassItem.__calculateSize</h4>
127 <b>__calculateSize</b>(<i></i>) 160 <b>__calculateSize</b>(<i></i>)
161
128 <p> 162 <p>
129 Private method to calculate the size of the class item. 163 Private method to calculate the size of the class item.
130 </p><a NAME="ClassItem.__createTexts" ID="ClassItem.__createTexts"></a> 164 </p>
165 <a NAME="ClassItem.__createTexts" ID="ClassItem.__createTexts"></a>
131 <h4>ClassItem.__createTexts</h4> 166 <h4>ClassItem.__createTexts</h4>
132 <b>__createTexts</b>(<i></i>) 167 <b>__createTexts</b>(<i></i>)
168
133 <p> 169 <p>
134 Private method to create the text items of the class item. 170 Private method to create the text items of the class item.
135 </p><a NAME="ClassItem.buildItemDataString" ID="ClassItem.buildItemDataString"></a> 171 </p>
172 <a NAME="ClassItem.buildItemDataString" ID="ClassItem.buildItemDataString"></a>
136 <h4>ClassItem.buildItemDataString</h4> 173 <h4>ClassItem.buildItemDataString</h4>
137 <b>buildItemDataString</b>(<i></i>) 174 <b>buildItemDataString</b>(<i></i>)
175
138 <p> 176 <p>
139 Public method to build a string to persist the specific item data. 177 Public method to build a string to persist the specific item data.
140 </p><p> 178 </p>
179 <p>
141 This string must start with ", " and should be built like 180 This string must start with ", " and should be built like
142 "attribute=value" with pairs separated by ", ". value must not 181 "attribute=value" with pairs separated by ", ". value must not
143 contain ", " or newlines. 182 contain ", " or newlines.
144 </p><dl> 183 </p>
184 <dl>
145 <dt>Returns:</dt> 185 <dt>Returns:</dt>
146 <dd> 186 <dd>
147 persistence data (string) 187 persistence data (string)
148 </dd> 188 </dd>
149 </dl><a NAME="ClassItem.isExternal" ID="ClassItem.isExternal"></a> 189 </dl>
190 <a NAME="ClassItem.isExternal" ID="ClassItem.isExternal"></a>
150 <h4>ClassItem.isExternal</h4> 191 <h4>ClassItem.isExternal</h4>
151 <b>isExternal</b>(<i></i>) 192 <b>isExternal</b>(<i></i>)
193
152 <p> 194 <p>
153 Public method returning the external state. 195 Public method returning the external state.
154 </p><dl> 196 </p>
197 <dl>
155 <dt>Returns:</dt> 198 <dt>Returns:</dt>
156 <dd> 199 <dd>
157 external state (boolean) 200 external state (boolean)
158 </dd> 201 </dd>
159 </dl><a NAME="ClassItem.paint" ID="ClassItem.paint"></a> 202 </dl>
203 <a NAME="ClassItem.paint" ID="ClassItem.paint"></a>
160 <h4>ClassItem.paint</h4> 204 <h4>ClassItem.paint</h4>
161 <b>paint</b>(<i>painter, option, widget=None</i>) 205 <b>paint</b>(<i>painter, option, widget=None</i>)
206
162 <p> 207 <p>
163 Public method to paint the item in local coordinates. 208 Public method to paint the item in local coordinates.
164 </p><dl> 209 </p>
210 <dl>
211
165 <dt><i>painter</i></dt> 212 <dt><i>painter</i></dt>
166 <dd> 213 <dd>
167 reference to the painter object (QPainter) 214 reference to the painter object (QPainter)
168 </dd><dt><i>option</i></dt> 215 </dd>
216 <dt><i>option</i></dt>
169 <dd> 217 <dd>
170 style options (QStyleOptionGraphicsItem) 218 style options (QStyleOptionGraphicsItem)
171 </dd><dt><i>widget</i></dt> 219 </dd>
220 <dt><i>widget</i></dt>
172 <dd> 221 <dd>
173 optional reference to the widget painted on (QWidget) 222 optional reference to the widget painted on (QWidget)
174 </dd> 223 </dd>
175 </dl><a NAME="ClassItem.parseItemDataString" ID="ClassItem.parseItemDataString"></a> 224 </dl>
225 <a NAME="ClassItem.parseItemDataString" ID="ClassItem.parseItemDataString"></a>
176 <h4>ClassItem.parseItemDataString</h4> 226 <h4>ClassItem.parseItemDataString</h4>
177 <b>parseItemDataString</b>(<i>version, data</i>) 227 <b>parseItemDataString</b>(<i>version, data</i>)
228
178 <p> 229 <p>
179 Public method to parse the given persistence data. 230 Public method to parse the given persistence data.
180 </p><dl> 231 </p>
232 <dl>
233
181 <dt><i>version</i></dt> 234 <dt><i>version</i></dt>
182 <dd> 235 <dd>
183 version of the data (string) 236 version of the data (string)
184 </dd><dt><i>data</i></dt> 237 </dd>
238 <dt><i>data</i></dt>
185 <dd> 239 <dd>
186 persisted data to be parsed (string) 240 persisted data to be parsed (string)
187 </dd> 241 </dd>
188 </dl><dl> 242 </dl>
243 <dl>
189 <dt>Returns:</dt> 244 <dt>Returns:</dt>
190 <dd> 245 <dd>
191 flag indicating success (boolean) 246 flag indicating success (boolean)
192 </dd> 247 </dd>
193 </dl><a NAME="ClassItem.setModel" ID="ClassItem.setModel"></a> 248 </dl>
249 <a NAME="ClassItem.setModel" ID="ClassItem.setModel"></a>
194 <h4>ClassItem.setModel</h4> 250 <h4>ClassItem.setModel</h4>
195 <b>setModel</b>(<i>model</i>) 251 <b>setModel</b>(<i>model</i>)
252
196 <p> 253 <p>
197 Public method to set the class model. 254 Public method to set the class model.
198 </p><dl> 255 </p>
256 <dl>
257
199 <dt><i>model</i></dt> 258 <dt><i>model</i></dt>
200 <dd> 259 <dd>
201 class model containing the class data (ClassModel) 260 class model containing the class data (ClassModel)
202 </dd> 261 </dd>
203 </dl> 262 </dl>
204 <div align="right"><a href="#top">Up</a></div> 263 <div align="right"><a href="#top">Up</a></div>
205 <hr /><hr /> 264 <hr />
265 <hr />
206 <a NAME="ClassModel" ID="ClassModel"></a> 266 <a NAME="ClassModel" ID="ClassModel"></a>
207 <h2>ClassModel</h2> 267 <h2>ClassModel</h2>
268
208 <p> 269 <p>
209 Class implementing the class model. 270 Class implementing the class model.
210 </p> 271 </p>
211 <h3>Derived from</h3> 272 <h3>Derived from</h3>
212 UMLModel 273 UMLModel
213 <h3>Class Attributes</h3> 274 <h3>Class Attributes</h3>
275
214 <table> 276 <table>
215 <tr><td>None</td></tr> 277 <tr><td>None</td></tr>
216 </table> 278 </table>
217 <h3>Class Methods</h3> 279 <h3>Class Methods</h3>
280
218 <table> 281 <table>
219 <tr><td>None</td></tr> 282 <tr><td>None</td></tr>
220 </table> 283 </table>
221 <h3>Methods</h3> 284 <h3>Methods</h3>
222 <table> 285
286 <table>
287
223 <tr> 288 <tr>
224 <td><a href="#ClassModel.__init__">ClassModel</a></td> 289 <td><a href="#ClassModel.__init__">ClassModel</a></td>
225 <td>Constructor</td> 290 <td>Constructor</td>
226 </tr><tr> 291 </tr>
292 <tr>
227 <td><a href="#ClassModel.addAttribute">addAttribute</a></td> 293 <td><a href="#ClassModel.addAttribute">addAttribute</a></td>
228 <td>Public method to add an attribute to the class model.</td> 294 <td>Public method to add an attribute to the class model.</td>
229 </tr><tr> 295 </tr>
296 <tr>
230 <td><a href="#ClassModel.addMethod">addMethod</a></td> 297 <td><a href="#ClassModel.addMethod">addMethod</a></td>
231 <td>Public method to add a method to the class model.</td> 298 <td>Public method to add a method to the class model.</td>
232 </tr><tr> 299 </tr>
300 <tr>
233 <td><a href="#ClassModel.getAttributes">getAttributes</a></td> 301 <td><a href="#ClassModel.getAttributes">getAttributes</a></td>
234 <td>Public method to retrieve the attributes of the class.</td> 302 <td>Public method to retrieve the attributes of the class.</td>
235 </tr><tr> 303 </tr>
304 <tr>
236 <td><a href="#ClassModel.getMethods">getMethods</a></td> 305 <td><a href="#ClassModel.getMethods">getMethods</a></td>
237 <td>Public method to retrieve the methods of the class.</td> 306 <td>Public method to retrieve the methods of the class.</td>
238 </tr> 307 </tr>
239 </table> 308 </table>
240 <h3>Static Methods</h3> 309 <h3>Static Methods</h3>
241 <table> 310
242 <tr><td>None</td></tr> 311 <table>
243 </table> 312 <tr><td>None</td></tr>
313 </table>
314
244 <a NAME="ClassModel.__init__" ID="ClassModel.__init__"></a> 315 <a NAME="ClassModel.__init__" ID="ClassModel.__init__"></a>
245 <h4>ClassModel (Constructor)</h4> 316 <h4>ClassModel (Constructor)</h4>
246 <b>ClassModel</b>(<i>name, methods=None, attributes=None</i>) 317 <b>ClassModel</b>(<i>name, methods=None, attributes=None</i>)
318
247 <p> 319 <p>
248 Constructor 320 Constructor
249 </p><dl> 321 </p>
322 <dl>
323
250 <dt><i>name</i></dt> 324 <dt><i>name</i></dt>
251 <dd> 325 <dd>
252 the class name (string) 326 the class name (string)
253 </dd><dt><i>methods</i></dt> 327 </dd>
328 <dt><i>methods</i></dt>
254 <dd> 329 <dd>
255 list of method names of the class 330 list of method names of the class
256 (list of strings) 331 (list of strings)
257 </dd><dt><i>attributes</i></dt> 332 </dd>
333 <dt><i>attributes</i></dt>
258 <dd> 334 <dd>
259 list of attribute names of the class 335 list of attribute names of the class
260 (list of strings) 336 (list of strings)
261 </dd> 337 </dd>
262 </dl><a NAME="ClassModel.addAttribute" ID="ClassModel.addAttribute"></a> 338 </dl>
339 <a NAME="ClassModel.addAttribute" ID="ClassModel.addAttribute"></a>
263 <h4>ClassModel.addAttribute</h4> 340 <h4>ClassModel.addAttribute</h4>
264 <b>addAttribute</b>(<i>attribute</i>) 341 <b>addAttribute</b>(<i>attribute</i>)
342
265 <p> 343 <p>
266 Public method to add an attribute to the class model. 344 Public method to add an attribute to the class model.
267 </p><dl> 345 </p>
346 <dl>
347
268 <dt><i>attribute</i></dt> 348 <dt><i>attribute</i></dt>
269 <dd> 349 <dd>
270 attribute name to be added (string) 350 attribute name to be added (string)
271 </dd> 351 </dd>
272 </dl><a NAME="ClassModel.addMethod" ID="ClassModel.addMethod"></a> 352 </dl>
353 <a NAME="ClassModel.addMethod" ID="ClassModel.addMethod"></a>
273 <h4>ClassModel.addMethod</h4> 354 <h4>ClassModel.addMethod</h4>
274 <b>addMethod</b>(<i>method</i>) 355 <b>addMethod</b>(<i>method</i>)
356
275 <p> 357 <p>
276 Public method to add a method to the class model. 358 Public method to add a method to the class model.
277 </p><dl> 359 </p>
360 <dl>
361
278 <dt><i>method</i></dt> 362 <dt><i>method</i></dt>
279 <dd> 363 <dd>
280 method name to be added (string) 364 method name to be added (string)
281 </dd> 365 </dd>
282 </dl><a NAME="ClassModel.getAttributes" ID="ClassModel.getAttributes"></a> 366 </dl>
367 <a NAME="ClassModel.getAttributes" ID="ClassModel.getAttributes"></a>
283 <h4>ClassModel.getAttributes</h4> 368 <h4>ClassModel.getAttributes</h4>
284 <b>getAttributes</b>(<i></i>) 369 <b>getAttributes</b>(<i></i>)
370
285 <p> 371 <p>
286 Public method to retrieve the attributes of the class. 372 Public method to retrieve the attributes of the class.
287 </p><dl> 373 </p>
374 <dl>
288 <dt>Returns:</dt> 375 <dt>Returns:</dt>
289 <dd> 376 <dd>
290 list of class attributes (list of strings) 377 list of class attributes (list of strings)
291 </dd> 378 </dd>
292 </dl><a NAME="ClassModel.getMethods" ID="ClassModel.getMethods"></a> 379 </dl>
380 <a NAME="ClassModel.getMethods" ID="ClassModel.getMethods"></a>
293 <h4>ClassModel.getMethods</h4> 381 <h4>ClassModel.getMethods</h4>
294 <b>getMethods</b>(<i></i>) 382 <b>getMethods</b>(<i></i>)
383
295 <p> 384 <p>
296 Public method to retrieve the methods of the class. 385 Public method to retrieve the methods of the class.
297 </p><dl> 386 </p>
387 <dl>
298 <dt>Returns:</dt> 388 <dt>Returns:</dt>
299 <dd> 389 <dd>
300 list of class methods (list of strings) 390 list of class methods (list of strings)
301 </dd> 391 </dd>
302 </dl> 392 </dl>

eric ide

mercurial