/[thuban]/trunk/thuban/Thuban/Model/layer.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/Model/layer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 464 by jonathan, Wed Mar 5 18:17:47 2003 UTC revision 492 by jonathan, Mon Mar 10 10:44:57 2003 UTC
# Line 142  class Layer(BaseLayer): Line 142  class Layer(BaseLayer):
142          self.shapetable = Table(filename)          self.shapetable = Table(filename)
143          self.table = self.shapetable          self.table = self.shapetable
144    
145          self.__classification = classification.Classification(self)          #
146            # this is really important so that when the classification class
147            # tries to set its parent layer the variable will exist
148            #
149            self.__classification = None
150    
151    
152            self.SetClassification(None)
153    
154          self.__classification.SetDefaultLineColor(stroke)          self.__classification.SetDefaultLineColor(stroke)
155          self.__classification.SetDefaultLineWidth(lineWidth)          self.__classification.SetDefaultLineWidth(lineWidth)
156          self.__classification.SetDefaultFill(fill)          self.__classification.SetDefaultFill(fill)
157            self.__classification.SetLayer(self)
158    
159          self.UnsetModified()          self.UnsetModified()
160    
# Line 262  class Layer(BaseLayer): Line 271  class Layer(BaseLayer):
271          return self.__classification          return self.__classification
272    
273      def SetClassification(self, clazz):      def SetClassification(self, clazz):
274          self.__classification = clazz          """Set the classification to 'clazz'
275    
276            If 'clazz' is None a default classification is created
277            """
278    
279            if clazz is None:
280                self.__classification = classification.Classification()
281            else:
282    
283                # prevent infinite recursion when calling SetLayer()
284                if clazz == self.__classification:
285                    return
286    
287                self.__classification = clazz
288                self.__classification.SetLayer(self)
289    
290          self.changed(LAYER_LEGEND_CHANGED, self)          self.changed(LAYER_LEGEND_CHANGED, self)
291    
292        def ClassChanged(self):
293            """Called from the classification object when it has changed."""
294            self.changed(LAYER_LEGEND_CHANGED, self)
295    
296      def TreeInfo(self):      def TreeInfo(self):
297          items = []          items = []
298    

Legend:
Removed from v.464  
changed lines
  Added in v.492

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26