Graphics/ModuleItem.py

changeset 2030
db11a2fe9bbc
parent 1509
c0b5e693b0eb
child 2032
704593d042fe
equal deleted inserted replaced
2028:30247d523fdb 2030:db11a2fe9bbc
159 painter.drawRect(offsetX, offsetY, w, h) 159 painter.drawRect(offsetX, offsetY, w, h)
160 y = self.margin + self.header.boundingRect().height() 160 y = self.margin + self.header.boundingRect().height()
161 painter.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y) 161 painter.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y)
162 162
163 self.adjustAssociations() 163 self.adjustAssociations()
164
165 def buildItemDataString(self):
166 """
167 Public method to build a string to persist the specific item data.
168
169 This string must start with ", " and should be built like
170 "attribute=value" with pairs separated by ", ". value must not contain ", "
171 or newlines.
172
173 @return persistence data (string)
174 """
175 entries = [
176 "item_type=module",
177 "name={0}".format(self.model.getName()),
178 ]
179 classes = self.model.getClasses()
180 if classes:
181 entries.append("classes={0}".format("||".join(classes)))
182
183 return ", " + ", ".join(entries)
184
185 def parseItemDataString(self, data):
186 """
187 Public method to parse the given persistence data.
188
189 @param data persisted data to be parsed (string)
190 """
191 # TODO: implement this

eric ide

mercurial