Salome HOME
0db911bb635939607591b5f37b4e953706402b81
[modules/gui.git] / tools / CurvePlot / src / python / model / Model.py
1 class Model(object):
2     START_ID = -1
3   
4     @classmethod
5     def __GenerateID(cls):
6         cls.START_ID += 1
7         return cls.START_ID
8
9     def __init__( self, controller ):
10         """Constructor"""
11     
12         self._name = None
13         self._controller = controller
14         self._id = self.__GenerateID()  # A unique ID for this class of object
15     
16     def getID(self):
17         return self._id
18       
19     def getController(self):
20         """
21         :returns: Controller -- This model's controller.
22         """
23         return self._controller
24     
25     def setController(self, controller):
26         """
27         Sets the controller of this model.
28         
29         :param controller: Controller -- The controller of the model.
30         
31         """
32         self._controller = controller
33     
34     def notifyChange( self, what="" ) :
35         """
36         Notifies the controller that this model's data has changed.
37         """
38         if self._controller != None:
39             self._controller.notify(self, what)
40     
41     def updateTimeStamps (self, modifiesList):
42         raise NotImplementedError
43
44 pass