|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Graphics.UMLClassDiagramBuilder</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.UMLClassDiagramBuilder</h1> |
|
23 <p> |
|
24 Module implementing a dialog showing a UML like class diagram. |
|
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="#UMLClassDiagramBuilder">UMLClassDiagramBuilder</a></td> |
|
34 <td>Class implementing a builder for UML like class diagrams.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="UMLClassDiagramBuilder" ID="UMLClassDiagramBuilder"></a> |
|
43 <h2>UMLClassDiagramBuilder</h2> |
|
44 <p> |
|
45 Class implementing a builder for UML like class diagrams. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 UMLDiagramBuilder |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#UMLClassDiagramBuilder.__init__">UMLClassDiagramBuilder</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#UMLClassDiagramBuilder.__addExternalClass">__addExternalClass</a></td> |
|
64 <td>Private method to add a class defined outside the module.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#UMLClassDiagramBuilder.__addLocalClass">__addLocalClass</a></td> |
|
67 <td>Private method to add a class defined in the module.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#UMLClassDiagramBuilder.__arrangeClasses">__arrangeClasses</a></td> |
|
70 <td>Private method to arrange the shapes on the canvas.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#UMLClassDiagramBuilder.__createAssociations">__createAssociations</a></td> |
|
73 <td>Private method to generate the associations between the class shapes.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#UMLClassDiagramBuilder.__getCurrentShape">__getCurrentShape</a></td> |
|
76 <td>Private method to get the named shape.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#UMLClassDiagramBuilder.buildDiagram">buildDiagram</a></td> |
|
79 <td>Public method to build the class shapes of the class diagram.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#UMLClassDiagramBuilder.getPersistenceData">getPersistenceData</a></td> |
|
82 <td>Public method to get a string for data to be persisted.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#UMLClassDiagramBuilder.initialize">initialize</a></td> |
|
85 <td>Public method to initialize the object.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#UMLClassDiagramBuilder.parsePersistenceData">parsePersistenceData</a></td> |
|
88 <td>Public method to parse persisted data.</td> |
|
89 </tr> |
|
90 </table> |
|
91 <h3>Static Methods</h3> |
|
92 <table> |
|
93 <tr><td>None</td></tr> |
|
94 </table> |
|
95 <a NAME="UMLClassDiagramBuilder.__init__" ID="UMLClassDiagramBuilder.__init__"></a> |
|
96 <h4>UMLClassDiagramBuilder (Constructor)</h4> |
|
97 <b>UMLClassDiagramBuilder</b>(<i>dialog, view, project, file, noAttrs=False</i>) |
|
98 <p> |
|
99 Constructor |
|
100 </p><dl> |
|
101 <dt><i>dialog</i></dt> |
|
102 <dd> |
|
103 reference to the UML dialog (UMLDialog) |
|
104 </dd><dt><i>view</i></dt> |
|
105 <dd> |
|
106 reference to the view object (UMLGraphicsView) |
|
107 </dd><dt><i>project</i></dt> |
|
108 <dd> |
|
109 reference to the project object (Project) |
|
110 </dd><dt><i>file</i></dt> |
|
111 <dd> |
|
112 file name of a python module to be shown (string) |
|
113 </dd><dt><i>noAttrs=</i></dt> |
|
114 <dd> |
|
115 flag indicating, that no attributes should be shown |
|
116 (boolean) |
|
117 </dd> |
|
118 </dl><a NAME="UMLClassDiagramBuilder.__addExternalClass" ID="UMLClassDiagramBuilder.__addExternalClass"></a> |
|
119 <h4>UMLClassDiagramBuilder.__addExternalClass</h4> |
|
120 <b>__addExternalClass</b>(<i>_class, x, y</i>) |
|
121 <p> |
|
122 Private method to add a class defined outside the module. |
|
123 </p><p> |
|
124 If the canvas is too small to take the shape, it |
|
125 is enlarged. |
|
126 </p><dl> |
|
127 <dt><i>_class</i></dt> |
|
128 <dd> |
|
129 class to be shown (string) |
|
130 </dd><dt><i>x</i></dt> |
|
131 <dd> |
|
132 x-coordinate (float) |
|
133 </dd><dt><i>y</i></dt> |
|
134 <dd> |
|
135 y-coordinate (float) |
|
136 </dd> |
|
137 </dl><a NAME="UMLClassDiagramBuilder.__addLocalClass" ID="UMLClassDiagramBuilder.__addLocalClass"></a> |
|
138 <h4>UMLClassDiagramBuilder.__addLocalClass</h4> |
|
139 <b>__addLocalClass</b>(<i>className, _class, x, y, isRbModule=False</i>) |
|
140 <p> |
|
141 Private method to add a class defined in the module. |
|
142 </p><dl> |
|
143 <dt><i>className</i></dt> |
|
144 <dd> |
|
145 name of the class to be as a dictionary key (string) |
|
146 </dd><dt><i>_class</i></dt> |
|
147 <dd> |
|
148 class to be shown (ModuleParser.Class) |
|
149 </dd><dt><i>x</i></dt> |
|
150 <dd> |
|
151 x-coordinate (float) |
|
152 </dd><dt><i>y</i></dt> |
|
153 <dd> |
|
154 y-coordinate (float) |
|
155 </dd><dt><i>isRbModule</i></dt> |
|
156 <dd> |
|
157 flag indicating a Ruby module (boolean) |
|
158 </dd> |
|
159 </dl><a NAME="UMLClassDiagramBuilder.__arrangeClasses" ID="UMLClassDiagramBuilder.__arrangeClasses"></a> |
|
160 <h4>UMLClassDiagramBuilder.__arrangeClasses</h4> |
|
161 <b>__arrangeClasses</b>(<i>nodes, routes, whiteSpaceFactor=1.2</i>) |
|
162 <p> |
|
163 Private method to arrange the shapes on the canvas. |
|
164 </p><p> |
|
165 The algorithm is borrowed from Boa Constructor. |
|
166 </p><dl> |
|
167 <dt><i>nodes</i></dt> |
|
168 <dd> |
|
169 list of nodes to arrange |
|
170 </dd><dt><i>routes</i></dt> |
|
171 <dd> |
|
172 list of routes |
|
173 </dd><dt><i>whiteSpaceFactor</i></dt> |
|
174 <dd> |
|
175 factor to increase whitespace between |
|
176 items (float) |
|
177 </dd> |
|
178 </dl><a NAME="UMLClassDiagramBuilder.__createAssociations" ID="UMLClassDiagramBuilder.__createAssociations"></a> |
|
179 <h4>UMLClassDiagramBuilder.__createAssociations</h4> |
|
180 <b>__createAssociations</b>(<i>routes</i>) |
|
181 <p> |
|
182 Private method to generate the associations between the class shapes. |
|
183 </p><dl> |
|
184 <dt><i>routes</i></dt> |
|
185 <dd> |
|
186 list of relationsships |
|
187 </dd> |
|
188 </dl><a NAME="UMLClassDiagramBuilder.__getCurrentShape" ID="UMLClassDiagramBuilder.__getCurrentShape"></a> |
|
189 <h4>UMLClassDiagramBuilder.__getCurrentShape</h4> |
|
190 <b>__getCurrentShape</b>(<i>name</i>) |
|
191 <p> |
|
192 Private method to get the named shape. |
|
193 </p><dl> |
|
194 <dt><i>name</i></dt> |
|
195 <dd> |
|
196 name of the shape (string) |
|
197 </dd> |
|
198 </dl><dl> |
|
199 <dt>Returns:</dt> |
|
200 <dd> |
|
201 shape (QGraphicsItem) |
|
202 </dd> |
|
203 </dl><a NAME="UMLClassDiagramBuilder.buildDiagram" ID="UMLClassDiagramBuilder.buildDiagram"></a> |
|
204 <h4>UMLClassDiagramBuilder.buildDiagram</h4> |
|
205 <b>buildDiagram</b>(<i></i>) |
|
206 <p> |
|
207 Public method to build the class shapes of the class diagram. |
|
208 </p><p> |
|
209 The algorithm is borrowed from Boa Constructor. |
|
210 </p><a NAME="UMLClassDiagramBuilder.getPersistenceData" ID="UMLClassDiagramBuilder.getPersistenceData"></a> |
|
211 <h4>UMLClassDiagramBuilder.getPersistenceData</h4> |
|
212 <b>getPersistenceData</b>(<i></i>) |
|
213 <p> |
|
214 Public method to get a string for data to be persisted. |
|
215 </p><dl> |
|
216 <dt>Returns:</dt> |
|
217 <dd> |
|
218 persisted data string (string) |
|
219 </dd> |
|
220 </dl><a NAME="UMLClassDiagramBuilder.initialize" ID="UMLClassDiagramBuilder.initialize"></a> |
|
221 <h4>UMLClassDiagramBuilder.initialize</h4> |
|
222 <b>initialize</b>(<i></i>) |
|
223 <p> |
|
224 Public method to initialize the object. |
|
225 </p><a NAME="UMLClassDiagramBuilder.parsePersistenceData" ID="UMLClassDiagramBuilder.parsePersistenceData"></a> |
|
226 <h4>UMLClassDiagramBuilder.parsePersistenceData</h4> |
|
227 <b>parsePersistenceData</b>(<i>version, data</i>) |
|
228 <p> |
|
229 Public method to parse persisted data. |
|
230 </p><dl> |
|
231 <dt><i>version</i></dt> |
|
232 <dd> |
|
233 version of the data (string) |
|
234 </dd><dt><i>data</i></dt> |
|
235 <dd> |
|
236 persisted data to be parsed (string) |
|
237 </dd> |
|
238 </dl><dl> |
|
239 <dt>Returns:</dt> |
|
240 <dd> |
|
241 flag indicating success (boolean) |
|
242 </dd> |
|
243 </dl> |
|
244 <div align="right"><a href="#top">Up</a></div> |
|
245 <hr /> |
|
246 </body></html> |