|
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>eric5.Graphics.ClassItem</title> |
|
6 <style> |
|
7 b'body {\n background:white;\n margin: 0em 1em 10em 1em;\n color: black;\n}\n\nh1 { color: white; background: #4FA4FF; }\nh2 { color: white; background: #4FA4FF; }\nh3 { color: white; background: #00557F; }\nh4 { color: white; background: #00557F; }\n \na { color: #AA5500; }\n' |
|
8 </style> |
|
9 </head> |
|
10 <body><a NAME="top" ID="top"></a> |
|
11 <h1>eric5.Graphics.ClassItem</h1> |
|
12 <p> |
|
13 Module implementing an UML like class item. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 <table> |
|
21 <tr> |
|
22 <td><a href="#ClassItem">ClassItem</a></td> |
|
23 <td>Class implementing an UML like class item.</td> |
|
24 </tr><tr> |
|
25 <td><a href="#ClassModel">ClassModel</a></td> |
|
26 <td>Class implementing the class model.</td> |
|
27 </tr> |
|
28 </table> |
|
29 <h3>Functions</h3> |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /><hr /> |
|
34 <a NAME="ClassItem" ID="ClassItem"></a> |
|
35 <h2>ClassItem</h2> |
|
36 <p> |
|
37 Class implementing an UML like class item. |
|
38 </p> |
|
39 <h3>Derived from</h3> |
|
40 UMLItem |
|
41 <h3>Class Attributes</h3> |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <h3>Methods</h3> |
|
46 <table> |
|
47 <tr> |
|
48 <td><a href="#ClassItem.__init__">ClassItem</a></td> |
|
49 <td>Constructor</td> |
|
50 </tr><tr> |
|
51 <td><a href="#ClassItem.__calculateSize">__calculateSize</a></td> |
|
52 <td>Private method to calculate the size of the class item.</td> |
|
53 </tr><tr> |
|
54 <td><a href="#ClassItem.__createTexts">__createTexts</a></td> |
|
55 <td>Private method to create the text items of the class item.</td> |
|
56 </tr><tr> |
|
57 <td><a href="#ClassItem.isExternal">isExternal</a></td> |
|
58 <td>Method returning the external state.</td> |
|
59 </tr><tr> |
|
60 <td><a href="#ClassItem.paint">paint</a></td> |
|
61 <td>Public method to paint the item in local coordinates.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#ClassItem.setModel">setModel</a></td> |
|
64 <td>Method to set the class model.</td> |
|
65 </tr> |
|
66 </table> |
|
67 <a NAME="ClassItem.__init__" ID="ClassItem.__init__"></a> |
|
68 <h4>ClassItem (Constructor)</h4> |
|
69 <b>ClassItem</b>(<i>model = None, external = False, x = 0, y = 0, rounded = False, noAttrs = False, parent = None, scene = None</i>) |
|
70 <p> |
|
71 Constructor |
|
72 </p><dl> |
|
73 <dt><i>model</i></dt> |
|
74 <dd> |
|
75 class model containing the class data (ClassModel) |
|
76 </dd><dt><i>external</i></dt> |
|
77 <dd> |
|
78 flag indicating a class defined outside our scope (boolean) |
|
79 </dd><dt><i>x</i></dt> |
|
80 <dd> |
|
81 x-coordinate (integer) |
|
82 </dd><dt><i>y</i></dt> |
|
83 <dd> |
|
84 y-coordinate (integer) |
|
85 </dd><dt><i>rounded=</i></dt> |
|
86 <dd> |
|
87 flag indicating a rounded corner (boolean) |
|
88 </dd><dt><i>noAttrs=</i></dt> |
|
89 <dd> |
|
90 flag indicating, that no attributes should be shown (boolean) |
|
91 </dd><dt><i>parent=</i></dt> |
|
92 <dd> |
|
93 reference to the parent object (QGraphicsItem) |
|
94 </dd><dt><i>scene=</i></dt> |
|
95 <dd> |
|
96 reference to the scene object (QGraphicsScene) |
|
97 </dd> |
|
98 </dl><a NAME="ClassItem.__calculateSize" ID="ClassItem.__calculateSize"></a> |
|
99 <h4>ClassItem.__calculateSize</h4> |
|
100 <b>__calculateSize</b>(<i></i>) |
|
101 <p> |
|
102 Private method to calculate the size of the class item. |
|
103 </p><a NAME="ClassItem.__createTexts" ID="ClassItem.__createTexts"></a> |
|
104 <h4>ClassItem.__createTexts</h4> |
|
105 <b>__createTexts</b>(<i></i>) |
|
106 <p> |
|
107 Private method to create the text items of the class item. |
|
108 </p><a NAME="ClassItem.isExternal" ID="ClassItem.isExternal"></a> |
|
109 <h4>ClassItem.isExternal</h4> |
|
110 <b>isExternal</b>(<i></i>) |
|
111 <p> |
|
112 Method returning the external state. |
|
113 </p><dl> |
|
114 <dt>Returns:</dt> |
|
115 <dd> |
|
116 external state (boolean) |
|
117 </dd> |
|
118 </dl><a NAME="ClassItem.paint" ID="ClassItem.paint"></a> |
|
119 <h4>ClassItem.paint</h4> |
|
120 <b>paint</b>(<i>painter, option, widget = None</i>) |
|
121 <p> |
|
122 Public method to paint the item in local coordinates. |
|
123 </p><dl> |
|
124 <dt><i>painter</i></dt> |
|
125 <dd> |
|
126 reference to the painter object (QPainter) |
|
127 </dd><dt><i>option</i></dt> |
|
128 <dd> |
|
129 style options (QStyleOptionGraphicsItem) |
|
130 </dd><dt><i>widget</i></dt> |
|
131 <dd> |
|
132 optional reference to the widget painted on (QWidget) |
|
133 </dd> |
|
134 </dl><a NAME="ClassItem.setModel" ID="ClassItem.setModel"></a> |
|
135 <h4>ClassItem.setModel</h4> |
|
136 <b>setModel</b>(<i>model</i>) |
|
137 <p> |
|
138 Method to set the class model. |
|
139 </p><dl> |
|
140 <dt><i>model</i></dt> |
|
141 <dd> |
|
142 class model containing the class data (ClassModel) |
|
143 </dd> |
|
144 </dl> |
|
145 <div align="right"><a href="#top">Up</a></div> |
|
146 <hr /><hr /> |
|
147 <a NAME="ClassModel" ID="ClassModel"></a> |
|
148 <h2>ClassModel</h2> |
|
149 <p> |
|
150 Class implementing the class model. |
|
151 </p> |
|
152 <h3>Derived from</h3> |
|
153 object |
|
154 <h3>Class Attributes</h3> |
|
155 <table> |
|
156 <tr><td>None</td></tr> |
|
157 </table> |
|
158 <h3>Methods</h3> |
|
159 <table> |
|
160 <tr> |
|
161 <td><a href="#ClassModel.__init__">ClassModel</a></td> |
|
162 <td>Constructor</td> |
|
163 </tr><tr> |
|
164 <td><a href="#ClassModel.addAttribute">addAttribute</a></td> |
|
165 <td>Method to add an attribute to the class model.</td> |
|
166 </tr><tr> |
|
167 <td><a href="#ClassModel.addMethod">addMethod</a></td> |
|
168 <td>Method to add a method to the class model.</td> |
|
169 </tr><tr> |
|
170 <td><a href="#ClassModel.getAttributes">getAttributes</a></td> |
|
171 <td>Method to retrieve the attributes of the class.</td> |
|
172 </tr><tr> |
|
173 <td><a href="#ClassModel.getMethods">getMethods</a></td> |
|
174 <td>Method to retrieve the methods of the class.</td> |
|
175 </tr><tr> |
|
176 <td><a href="#ClassModel.getName">getName</a></td> |
|
177 <td>Method to retrieve the class name.</td> |
|
178 </tr> |
|
179 </table> |
|
180 <a NAME="ClassModel.__init__" ID="ClassModel.__init__"></a> |
|
181 <h4>ClassModel (Constructor)</h4> |
|
182 <b>ClassModel</b>(<i>name, methods = [], attributes = []</i>) |
|
183 <p> |
|
184 Constructor |
|
185 </p><dl> |
|
186 <dt><i>name</i></dt> |
|
187 <dd> |
|
188 the class name (string) |
|
189 </dd><dt><i>methods</i></dt> |
|
190 <dd> |
|
191 list of method names of the class |
|
192 (list of strings) |
|
193 </dd><dt><i>attributes</i></dt> |
|
194 <dd> |
|
195 list of attribute names of the class |
|
196 (list of strings) |
|
197 </dd> |
|
198 </dl><a NAME="ClassModel.addAttribute" ID="ClassModel.addAttribute"></a> |
|
199 <h4>ClassModel.addAttribute</h4> |
|
200 <b>addAttribute</b>(<i>attribute</i>) |
|
201 <p> |
|
202 Method to add an attribute to the class model. |
|
203 </p><dl> |
|
204 <dt><i>attribute</i></dt> |
|
205 <dd> |
|
206 attribute name to be added (string) |
|
207 </dd> |
|
208 </dl><a NAME="ClassModel.addMethod" ID="ClassModel.addMethod"></a> |
|
209 <h4>ClassModel.addMethod</h4> |
|
210 <b>addMethod</b>(<i>method</i>) |
|
211 <p> |
|
212 Method to add a method to the class model. |
|
213 </p><dl> |
|
214 <dt><i>method</i></dt> |
|
215 <dd> |
|
216 method name to be added (string) |
|
217 </dd> |
|
218 </dl><a NAME="ClassModel.getAttributes" ID="ClassModel.getAttributes"></a> |
|
219 <h4>ClassModel.getAttributes</h4> |
|
220 <b>getAttributes</b>(<i></i>) |
|
221 <p> |
|
222 Method to retrieve the attributes of the class. |
|
223 </p><dl> |
|
224 <dt>Returns:</dt> |
|
225 <dd> |
|
226 list of class attributes (list of strings) |
|
227 </dd> |
|
228 </dl><a NAME="ClassModel.getMethods" ID="ClassModel.getMethods"></a> |
|
229 <h4>ClassModel.getMethods</h4> |
|
230 <b>getMethods</b>(<i></i>) |
|
231 <p> |
|
232 Method to retrieve the methods of the class. |
|
233 </p><dl> |
|
234 <dt>Returns:</dt> |
|
235 <dd> |
|
236 list of class methods (list of strings) |
|
237 </dd> |
|
238 </dl><a NAME="ClassModel.getName" ID="ClassModel.getName"></a> |
|
239 <h4>ClassModel.getName</h4> |
|
240 <b>getName</b>(<i></i>) |
|
241 <p> |
|
242 Method to retrieve the class name. |
|
243 </p><dl> |
|
244 <dt>Returns:</dt> |
|
245 <dd> |
|
246 class name (string) |
|
247 </dd> |
|
248 </dl> |
|
249 <div align="right"><a href="#top">Up</a></div> |
|
250 <hr /> |
|
251 </body></html> |