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 |
|
|
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 |
|
|