Graphics/UMLItem.py

changeset 2030
db11a2fe9bbc
parent 1509
c0b5e693b0eb
child 2033
4b99609f6a87
--- a/Graphics/UMLItem.py	Sat Sep 08 18:20:46 2012 +0200
+++ b/Graphics/UMLItem.py	Sun Sep 09 14:46:59 2012 +0200
@@ -31,6 +31,7 @@
         self.margin = 5
         self.associations = []
         self.shouldAdjustAssociations = False
+        self.__id = -1
         
         self.setRect(x, y, 60, 30)
         
@@ -144,3 +145,39 @@
         painter.setBrush(self.brush())
         painter.drawRect(self.rect())
         self.adjustAssociations()
+        
+    def setId(self, id):
+        """
+        Public method to assign an ID to the item.
+        
+        @param id assigned ID (integer)
+        """
+        self.__id = id
+    
+    def getId(self):
+        """
+        Public method to get the item ID.
+        
+        @return ID of the item (integer)
+        """
+        return self.__id
+    
+    def buildItemDataString(self):
+        """
+        Public method to build a string to persist the specific item data.
+        
+        This string must start with ", " and should be built like
+        "attribute=value" with pairs separated by ", ". value must not contain ", "
+        or newlines.
+        
+        @return persistence data (string)
+        """
+        return ""
+    
+    def parseItemDataString(self, data):
+        """
+        Public method to parse the given persistence data.
+        
+        @param data persisted data to be parsed (string)
+        """
+        pass

eric ide

mercurial