|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Graphics.ModuleItem</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.ModuleItem</h1> |
|
23 <p> |
|
24 Module implementing a module item. |
|
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="#ModuleItem">ModuleItem</a></td> |
|
34 <td>Class implementing a module item.</td> |
|
35 </tr><tr> |
|
36 <td><a href="#ModuleModel">ModuleModel</a></td> |
|
37 <td>Class implementing the module model.</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="ModuleItem" ID="ModuleItem"></a> |
|
46 <h2>ModuleItem</h2> |
|
47 <p> |
|
48 Class implementing a module item. |
|
49 </p> |
|
50 <h3>Derived from</h3> |
|
51 UMLItem |
|
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="#ModuleItem.__init__">ModuleItem</a></td> |
|
64 <td>Constructor</td> |
|
65 </tr><tr> |
|
66 <td><a href="#ModuleItem.__calculateSize">__calculateSize</a></td> |
|
67 <td>Private method to calculate the size of the module item.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#ModuleItem.__createTexts">__createTexts</a></td> |
|
70 <td>Private method to create the text items of the module item.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#ModuleItem.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="#ModuleItem.paint">paint</a></td> |
|
76 <td>Public method to paint the item in local coordinates.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#ModuleItem.parseItemDataString">parseItemDataString</a></td> |
|
79 <td>Public method to parse the given persistence data.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#ModuleItem.setModel">setModel</a></td> |
|
82 <td>Public method to set the module model.</td> |
|
83 </tr> |
|
84 </table> |
|
85 <h3>Static Methods</h3> |
|
86 <table> |
|
87 <tr><td>None</td></tr> |
|
88 </table> |
|
89 <a NAME="ModuleItem.__init__" ID="ModuleItem.__init__"></a> |
|
90 <h4>ModuleItem (Constructor)</h4> |
|
91 <b>ModuleItem</b>(<i>model=None, x=0, y=0, rounded=False, parent=None, scene=None</i>) |
|
92 <p> |
|
93 Constructor |
|
94 </p><dl> |
|
95 <dt><i>model</i></dt> |
|
96 <dd> |
|
97 module model containing the module data (ModuleModel) |
|
98 </dd><dt><i>x</i></dt> |
|
99 <dd> |
|
100 x-coordinate (integer) |
|
101 </dd><dt><i>y</i></dt> |
|
102 <dd> |
|
103 y-coordinate (integer) |
|
104 </dd><dt><i>rounded=</i></dt> |
|
105 <dd> |
|
106 flag indicating a rounded corner (boolean) |
|
107 </dd><dt><i>parent=</i></dt> |
|
108 <dd> |
|
109 reference to the parent object (QGraphicsItem) |
|
110 </dd><dt><i>scene=</i></dt> |
|
111 <dd> |
|
112 reference to the scene object (QGraphicsScene) |
|
113 </dd> |
|
114 </dl><a NAME="ModuleItem.__calculateSize" ID="ModuleItem.__calculateSize"></a> |
|
115 <h4>ModuleItem.__calculateSize</h4> |
|
116 <b>__calculateSize</b>(<i></i>) |
|
117 <p> |
|
118 Private method to calculate the size of the module item. |
|
119 </p><a NAME="ModuleItem.__createTexts" ID="ModuleItem.__createTexts"></a> |
|
120 <h4>ModuleItem.__createTexts</h4> |
|
121 <b>__createTexts</b>(<i></i>) |
|
122 <p> |
|
123 Private method to create the text items of the module item. |
|
124 </p><a NAME="ModuleItem.buildItemDataString" ID="ModuleItem.buildItemDataString"></a> |
|
125 <h4>ModuleItem.buildItemDataString</h4> |
|
126 <b>buildItemDataString</b>(<i></i>) |
|
127 <p> |
|
128 Public method to build a string to persist the specific item data. |
|
129 </p><p> |
|
130 This string must start with ", " and should be built like |
|
131 "attribute=value" with pairs separated by ", ". value must not |
|
132 contain ", " or newlines. |
|
133 </p><dl> |
|
134 <dt>Returns:</dt> |
|
135 <dd> |
|
136 persistence data (string) |
|
137 </dd> |
|
138 </dl><a NAME="ModuleItem.paint" ID="ModuleItem.paint"></a> |
|
139 <h4>ModuleItem.paint</h4> |
|
140 <b>paint</b>(<i>painter, option, widget=None</i>) |
|
141 <p> |
|
142 Public method to paint the item in local coordinates. |
|
143 </p><dl> |
|
144 <dt><i>painter</i></dt> |
|
145 <dd> |
|
146 reference to the painter object (QPainter) |
|
147 </dd><dt><i>option</i></dt> |
|
148 <dd> |
|
149 style options (QStyleOptionGraphicsItem) |
|
150 </dd><dt><i>widget</i></dt> |
|
151 <dd> |
|
152 optional reference to the widget painted on (QWidget) |
|
153 </dd> |
|
154 </dl><a NAME="ModuleItem.parseItemDataString" ID="ModuleItem.parseItemDataString"></a> |
|
155 <h4>ModuleItem.parseItemDataString</h4> |
|
156 <b>parseItemDataString</b>(<i>version, data</i>) |
|
157 <p> |
|
158 Public method to parse the given persistence data. |
|
159 </p><dl> |
|
160 <dt><i>version</i></dt> |
|
161 <dd> |
|
162 version of the data (string) |
|
163 </dd><dt><i>data</i></dt> |
|
164 <dd> |
|
165 persisted data to be parsed (string) |
|
166 </dd> |
|
167 </dl><dl> |
|
168 <dt>Returns:</dt> |
|
169 <dd> |
|
170 flag indicating success (boolean) |
|
171 </dd> |
|
172 </dl><a NAME="ModuleItem.setModel" ID="ModuleItem.setModel"></a> |
|
173 <h4>ModuleItem.setModel</h4> |
|
174 <b>setModel</b>(<i>model</i>) |
|
175 <p> |
|
176 Public method to set the module model. |
|
177 </p><dl> |
|
178 <dt><i>model</i></dt> |
|
179 <dd> |
|
180 module model containing the module data (ModuleModel) |
|
181 </dd> |
|
182 </dl> |
|
183 <div align="right"><a href="#top">Up</a></div> |
|
184 <hr /><hr /> |
|
185 <a NAME="ModuleModel" ID="ModuleModel"></a> |
|
186 <h2>ModuleModel</h2> |
|
187 <p> |
|
188 Class implementing the module model. |
|
189 </p> |
|
190 <h3>Derived from</h3> |
|
191 UMLModel |
|
192 <h3>Class Attributes</h3> |
|
193 <table> |
|
194 <tr><td>None</td></tr> |
|
195 </table> |
|
196 <h3>Class Methods</h3> |
|
197 <table> |
|
198 <tr><td>None</td></tr> |
|
199 </table> |
|
200 <h3>Methods</h3> |
|
201 <table> |
|
202 <tr> |
|
203 <td><a href="#ModuleModel.__init__">ModuleModel</a></td> |
|
204 <td>Constructor</td> |
|
205 </tr><tr> |
|
206 <td><a href="#ModuleModel.addClass">addClass</a></td> |
|
207 <td>Public method to add a class to the module model.</td> |
|
208 </tr><tr> |
|
209 <td><a href="#ModuleModel.getClasses">getClasses</a></td> |
|
210 <td>Public method to retrieve the classes of the module.</td> |
|
211 </tr> |
|
212 </table> |
|
213 <h3>Static Methods</h3> |
|
214 <table> |
|
215 <tr><td>None</td></tr> |
|
216 </table> |
|
217 <a NAME="ModuleModel.__init__" ID="ModuleModel.__init__"></a> |
|
218 <h4>ModuleModel (Constructor)</h4> |
|
219 <b>ModuleModel</b>(<i>name, classlist=[]</i>) |
|
220 <p> |
|
221 Constructor |
|
222 </p><dl> |
|
223 <dt><i>name</i></dt> |
|
224 <dd> |
|
225 the module name (string) |
|
226 </dd><dt><i>classlist</i></dt> |
|
227 <dd> |
|
228 list of class names (list of strings) |
|
229 </dd> |
|
230 </dl><a NAME="ModuleModel.addClass" ID="ModuleModel.addClass"></a> |
|
231 <h4>ModuleModel.addClass</h4> |
|
232 <b>addClass</b>(<i>classname</i>) |
|
233 <p> |
|
234 Public method to add a class to the module model. |
|
235 </p><dl> |
|
236 <dt><i>classname</i></dt> |
|
237 <dd> |
|
238 class name to be added (string) |
|
239 </dd> |
|
240 </dl><a NAME="ModuleModel.getClasses" ID="ModuleModel.getClasses"></a> |
|
241 <h4>ModuleModel.getClasses</h4> |
|
242 <b>getClasses</b>(<i></i>) |
|
243 <p> |
|
244 Public method to retrieve the classes of the module. |
|
245 </p><dl> |
|
246 <dt>Returns:</dt> |
|
247 <dd> |
|
248 list of class names (list of strings) |
|
249 </dd> |
|
250 </dl> |
|
251 <div align="right"><a href="#top">Up</a></div> |
|
252 <hr /> |
|
253 </body></html> |