35 self.methods = methods |
35 self.methods = methods |
36 self.attributes = attributes |
36 self.attributes = attributes |
37 |
37 |
38 def addMethod(self, method): |
38 def addMethod(self, method): |
39 """ |
39 """ |
40 Method to add a method to the class model. |
40 Public method to add a method to the class model. |
41 |
41 |
42 @param method method name to be added (string) |
42 @param method method name to be added (string) |
43 """ |
43 """ |
44 self.methods.append(method) |
44 self.methods.append(method) |
45 |
45 |
46 def addAttribute(self, attribute): |
46 def addAttribute(self, attribute): |
47 """ |
47 """ |
48 Method to add an attribute to the class model. |
48 Public method to add an attribute to the class model. |
49 |
49 |
50 @param attribute attribute name to be added (string) |
50 @param attribute attribute name to be added (string) |
51 """ |
51 """ |
52 self.attributes.append(attribute) |
52 self.attributes.append(attribute) |
53 |
53 |
54 def getMethods(self): |
54 def getMethods(self): |
55 """ |
55 """ |
56 Method to retrieve the methods of the class. |
56 Public method to retrieve the methods of the class. |
57 |
57 |
58 @return list of class methods (list of strings) |
58 @return list of class methods (list of strings) |
59 """ |
59 """ |
60 return self.methods[:] |
60 return self.methods[:] |
61 |
61 |
62 def getAttributes(self): |
62 def getAttributes(self): |
63 """ |
63 """ |
64 Method to retrieve the attributes of the class. |
64 Public method to retrieve the attributes of the class. |
65 |
65 |
66 @return list of class attributes (list of strings) |
66 @return list of class attributes (list of strings) |
67 """ |
67 """ |
68 return self.attributes[:] |
68 return self.attributes[:] |
69 |
69 |
159 height = height + self.meths.boundingRect().height() |
159 height = height + self.meths.boundingRect().height() |
160 self.setSize(width + 2 * self.margin, height + 2 * self.margin) |
160 self.setSize(width + 2 * self.margin, height + 2 * self.margin) |
161 |
161 |
162 def setModel(self, model): |
162 def setModel(self, model): |
163 """ |
163 """ |
164 Method to set the class model. |
164 Public method to set the class model. |
165 |
165 |
166 @param model class model containing the class data (ClassModel) |
166 @param model class model containing the class data (ClassModel) |
167 """ |
167 """ |
168 self.scene().removeItem(self.header) |
168 self.scene().removeItem(self.header) |
169 self.header = None |
169 self.header = None |