|
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.UMLItem</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.UMLItem</h1> |
|
12 <p> |
|
13 Module implementing the UMLWidget base class. |
|
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="#UMLItem">UMLItem</a></td> |
|
23 <td>Class implementing the UMLItem base class.</td> |
|
24 </tr> |
|
25 </table> |
|
26 <h3>Functions</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <hr /><hr /> |
|
31 <a NAME="UMLItem" ID="UMLItem"></a> |
|
32 <h2>UMLItem</h2> |
|
33 <p> |
|
34 Class implementing the UMLItem base class. |
|
35 </p> |
|
36 <h3>Derived from</h3> |
|
37 QGraphicsRectItem |
|
38 <h3>Class Attributes</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <h3>Methods</h3> |
|
43 <table> |
|
44 <tr> |
|
45 <td><a href="#UMLItem.__init__">UMLItem</a></td> |
|
46 <td>Constructor</td> |
|
47 </tr><tr> |
|
48 <td><a href="#UMLItem.addAssociation">addAssociation</a></td> |
|
49 <td>Method to add an association to this widget.</td> |
|
50 </tr><tr> |
|
51 <td><a href="#UMLItem.adjustAssociations">adjustAssociations</a></td> |
|
52 <td>Method to adjust the associations to widget movements.</td> |
|
53 </tr><tr> |
|
54 <td><a href="#UMLItem.itemChange">itemChange</a></td> |
|
55 <td>Protected method called when an items state changes.</td> |
|
56 </tr><tr> |
|
57 <td><a href="#UMLItem.moveBy">moveBy</a></td> |
|
58 <td>Overriden method to move the widget relative.</td> |
|
59 </tr><tr> |
|
60 <td><a href="#UMLItem.paint">paint</a></td> |
|
61 <td>Public method to paint the item in local coordinates.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#UMLItem.removeAssociation">removeAssociation</a></td> |
|
64 <td>Method to remove an association to this widget.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#UMLItem.removeAssociations">removeAssociations</a></td> |
|
67 <td>Method to remove all associations of this widget.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#UMLItem.setPos">setPos</a></td> |
|
70 <td>Overriden method to set the items position.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#UMLItem.setSize">setSize</a></td> |
|
73 <td>Public method to set the rectangles size.</td> |
|
74 </tr> |
|
75 </table> |
|
76 <a NAME="UMLItem.__init__" ID="UMLItem.__init__"></a> |
|
77 <h4>UMLItem (Constructor)</h4> |
|
78 <b>UMLItem</b>(<i>x = 0, y = 0, rounded = False, parent = None</i>) |
|
79 <p> |
|
80 Constructor |
|
81 </p><dl> |
|
82 <dt><i>x</i></dt> |
|
83 <dd> |
|
84 x-coordinate (integer) |
|
85 </dd><dt><i>y</i></dt> |
|
86 <dd> |
|
87 y-coordinate (integer) |
|
88 </dd><dt><i>rounded</i></dt> |
|
89 <dd> |
|
90 flag indicating a rounded corner (boolean) |
|
91 </dd><dt><i>parent=</i></dt> |
|
92 <dd> |
|
93 reference to the parent object (QGraphicsItem) |
|
94 </dd> |
|
95 </dl><a NAME="UMLItem.addAssociation" ID="UMLItem.addAssociation"></a> |
|
96 <h4>UMLItem.addAssociation</h4> |
|
97 <b>addAssociation</b>(<i>assoc</i>) |
|
98 <p> |
|
99 Method to add an association to this widget. |
|
100 </p><dl> |
|
101 <dt><i>assoc</i></dt> |
|
102 <dd> |
|
103 association to be added (AssociationWidget) |
|
104 </dd> |
|
105 </dl><a NAME="UMLItem.adjustAssociations" ID="UMLItem.adjustAssociations"></a> |
|
106 <h4>UMLItem.adjustAssociations</h4> |
|
107 <b>adjustAssociations</b>(<i></i>) |
|
108 <p> |
|
109 Method to adjust the associations to widget movements. |
|
110 </p><a NAME="UMLItem.itemChange" ID="UMLItem.itemChange"></a> |
|
111 <h4>UMLItem.itemChange</h4> |
|
112 <b>itemChange</b>(<i>change, value</i>) |
|
113 <p> |
|
114 Protected method called when an items state changes. |
|
115 </p><dl> |
|
116 <dt><i>change</i></dt> |
|
117 <dd> |
|
118 the item's change (QGraphicsItem.GraphicsItemChange) |
|
119 </dd><dt><i>value</i></dt> |
|
120 <dd> |
|
121 the value of the change |
|
122 </dd> |
|
123 </dl><dl> |
|
124 <dt>Returns:</dt> |
|
125 <dd> |
|
126 adjusted values |
|
127 </dd> |
|
128 </dl><a NAME="UMLItem.moveBy" ID="UMLItem.moveBy"></a> |
|
129 <h4>UMLItem.moveBy</h4> |
|
130 <b>moveBy</b>(<i>dx, dy</i>) |
|
131 <p> |
|
132 Overriden method to move the widget relative. |
|
133 </p><dl> |
|
134 <dt><i>dx</i></dt> |
|
135 <dd> |
|
136 relative movement in x-direction (float) |
|
137 </dd><dt><i>dy</i></dt> |
|
138 <dd> |
|
139 relative movement in y-direction (float) |
|
140 </dd> |
|
141 </dl><a NAME="UMLItem.paint" ID="UMLItem.paint"></a> |
|
142 <h4>UMLItem.paint</h4> |
|
143 <b>paint</b>(<i>painter, option, widget = None</i>) |
|
144 <p> |
|
145 Public method to paint the item in local coordinates. |
|
146 </p><dl> |
|
147 <dt><i>painter</i></dt> |
|
148 <dd> |
|
149 reference to the painter object (QPainter) |
|
150 </dd><dt><i>option</i></dt> |
|
151 <dd> |
|
152 style options (QStyleOptionGraphicsItem) |
|
153 </dd><dt><i>widget</i></dt> |
|
154 <dd> |
|
155 optional reference to the widget painted on (QWidget) |
|
156 </dd> |
|
157 </dl><a NAME="UMLItem.removeAssociation" ID="UMLItem.removeAssociation"></a> |
|
158 <h4>UMLItem.removeAssociation</h4> |
|
159 <b>removeAssociation</b>(<i>assoc</i>) |
|
160 <p> |
|
161 Method to remove an association to this widget. |
|
162 </p><dl> |
|
163 <dt><i>assoc</i></dt> |
|
164 <dd> |
|
165 association to be removed (AssociationWidget) |
|
166 </dd> |
|
167 </dl><a NAME="UMLItem.removeAssociations" ID="UMLItem.removeAssociations"></a> |
|
168 <h4>UMLItem.removeAssociations</h4> |
|
169 <b>removeAssociations</b>(<i></i>) |
|
170 <p> |
|
171 Method to remove all associations of this widget. |
|
172 </p><a NAME="UMLItem.setPos" ID="UMLItem.setPos"></a> |
|
173 <h4>UMLItem.setPos</h4> |
|
174 <b>setPos</b>(<i>x, y</i>) |
|
175 <p> |
|
176 Overriden method to set the items position. |
|
177 </p><dl> |
|
178 <dt><i>x</i></dt> |
|
179 <dd> |
|
180 absolute x-position (float) |
|
181 </dd><dt><i>y</i></dt> |
|
182 <dd> |
|
183 absolute y-position (float) |
|
184 </dd> |
|
185 </dl><a NAME="UMLItem.setSize" ID="UMLItem.setSize"></a> |
|
186 <h4>UMLItem.setSize</h4> |
|
187 <b>setSize</b>(<i>width, height</i>) |
|
188 <p> |
|
189 Public method to set the rectangles size. |
|
190 </p><dl> |
|
191 <dt><i>width</i></dt> |
|
192 <dd> |
|
193 width of the rectangle (float) |
|
194 </dd><dt><i>height</i></dt> |
|
195 <dd> |
|
196 height of the rectangle (float) |
|
197 </dd> |
|
198 </dl> |
|
199 <div align="right"><a href="#top">Up</a></div> |
|
200 <hr /> |
|
201 </body></html> |