23 |
# fix for people using python2.1 |
# fix for people using python2.1 |
24 |
from __future__ import nested_scopes |
from __future__ import nested_scopes |
25 |
|
|
26 |
|
import copy |
27 |
|
|
28 |
from types import * |
from types import * |
29 |
|
|
30 |
from messages import LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
from messages import LAYER_PROJECTION_CHANGED, LAYER_LEGEND_CHANGED, \ |
352 |
if props is not None: |
if props is not None: |
353 |
self.SetProperties(props) |
self.SetProperties(props) |
354 |
else: |
else: |
355 |
self.SetLineColor(Color.None) |
self.SetLineColor(Color.Black) |
356 |
self.SetLineWidth(1) |
self.SetLineWidth(1) |
357 |
self.SetFill(Color.None) |
self.SetFill(Color.None) |
358 |
|
|
416 |
def __ne__(self, other): |
def __ne__(self, other): |
417 |
return not self.__eq__(other) |
return not self.__eq__(other) |
418 |
|
|
419 |
|
def __copy__(self): |
420 |
|
return ClassGroupProperties(self) |
421 |
|
|
422 |
class ClassGroup: |
class ClassGroup: |
423 |
"""A base class for all Groups within a Classification""" |
"""A base class for all Groups within a Classification""" |
424 |
|
|
486 |
self.GetProperties(), |
self.GetProperties(), |
487 |
self.GetLabel()) |
self.GetLabel()) |
488 |
|
|
489 |
|
def __deepcopy__(self, memo): |
490 |
|
return ClassGroupSingleton(copy.copy(self.GetValue()), |
491 |
|
copy.copy(self.GetProperties()), |
492 |
|
copy.copy(self.GetLabel())) |
493 |
|
|
494 |
def GetValue(self): |
def GetValue(self): |
495 |
"""Return the associated value.""" |
"""Return the associated value.""" |
496 |
return self.value |
return self.value |
550 |
def __copy__(self): |
def __copy__(self): |
551 |
return ClassGroupDefault(self.GetProperties(), self.GetLabel()) |
return ClassGroupDefault(self.GetProperties(), self.GetLabel()) |
552 |
|
|
553 |
|
def __deepcopy__(self, memo): |
554 |
|
return ClassGroupDefault(copy.copy(self.GetProperties()), |
555 |
|
copy.copy(self.GetLabel())) |
556 |
|
|
557 |
def Matches(self, value): |
def Matches(self, value): |
558 |
return True |
return True |
559 |
|
|
612 |
self.GetProperties(), |
self.GetProperties(), |
613 |
self.GetLabel()) |
self.GetLabel()) |
614 |
|
|
615 |
|
def __deepcopy__(self, memo): |
616 |
|
return ClassGroupRange(copy.copy(self.GetMin()), |
617 |
|
copy.copy(self.GetMax()), |
618 |
|
copy.copy(self.GetProperties()), |
619 |
|
copy.copy(self.GetLabel())) |
620 |
|
|
621 |
def GetMin(self): |
def GetMin(self): |
622 |
"""Return the range's minimum value.""" |
"""Return the range's minimum value.""" |
623 |
return self.min |
return self.min |