511 |
def __deepcopy__(self): |
def __deepcopy__(self): |
512 |
return ClassGroupProperties(self) |
return ClassGroupProperties(self) |
513 |
|
|
514 |
|
def __repr__(self): |
515 |
|
return repr((self.__stroke, self.__strokeWidth, self.__fill)) |
516 |
|
|
517 |
class ClassGroup: |
class ClassGroup: |
518 |
"""A base class for all Groups within a Classification""" |
"""A base class for all Groups within a Classification""" |
519 |
|
|
542 |
label -- a string representing the Group's label. This must |
label -- a string representing the Group's label. This must |
543 |
not be None. |
not be None. |
544 |
""" |
""" |
545 |
assert isinstance(label, StringType) |
assert isinstance(label, StringTypes) |
546 |
self.label = label |
self.label = label |
547 |
|
|
548 |
def GetDisplayText(self): |
def GetDisplayText(self): |
581 |
|
|
582 |
def __eq__(self, other): |
def __eq__(self, other): |
583 |
return isinstance(other, ClassGroup) \ |
return isinstance(other, ClassGroup) \ |
584 |
|
and self.label == other.label \ |
585 |
and self.GetProperties() == other.GetProperties() |
and self.GetProperties() == other.GetProperties() |
586 |
|
|
587 |
def __ne__(self, other): |
def __ne__(self, other): |
588 |
return not self.__eq__(other) |
return not self.__eq__(other) |
589 |
|
|
590 |
|
def __repr__(self): |
591 |
|
return "'" + self.label + "', " + repr(self.GetProperties()) |
592 |
|
|
593 |
class ClassGroupSingleton(ClassGroup): |
class ClassGroupSingleton(ClassGroup): |
594 |
"""A Group that is associated with a single value.""" |
"""A Group that is associated with a single value.""" |
642 |
and isinstance(other, ClassGroupSingleton) \ |
and isinstance(other, ClassGroupSingleton) \ |
643 |
and self.__value == other.__value |
and self.__value == other.__value |
644 |
|
|
645 |
|
def __repr__(self): |
646 |
|
return "(" + self.__value + ", " + ClassGroup.__repr__(self) + ")" |
647 |
|
|
648 |
class ClassGroupDefault(ClassGroup): |
class ClassGroupDefault(ClassGroup): |
649 |
"""The default Group. When values do not match any other |
"""The default Group. When values do not match any other |
650 |
Group within a Classification, the properties from this |
Group within a Classification, the properties from this |
682 |
and isinstance(other, ClassGroupDefault) \ |
and isinstance(other, ClassGroupDefault) \ |
683 |
and self.GetProperties() == other.GetProperties() |
and self.GetProperties() == other.GetProperties() |
684 |
|
|
685 |
|
def __repr__(self): |
686 |
|
return "(" + ClassGroup.__repr__(self) + ")" |
687 |
|
|
688 |
class ClassGroupRange(ClassGroup): |
class ClassGroupRange(ClassGroup): |
689 |
"""A Group that represents a range of values that map to the same |
"""A Group that represents a range of values that map to the same |
690 |
set of properties.""" |
set of properties.""" |
736 |
|
|
737 |
def GetMax(self): |
def GetMax(self): |
738 |
"""Return the range's maximum value.""" |
"""Return the range's maximum value.""" |
739 |
return self.max |
return self.__max |
740 |
|
|
741 |
def SetMax(self, max): |
def SetMax(self, max): |
742 |
"""Set the range's maximum value. |
"""Set the range's maximum value. |
786 |
and self.__min == other.__min \ |
and self.__min == other.__min \ |
787 |
and self.__max == other.__max |
and self.__max == other.__max |
788 |
|
|
789 |
|
def __repr__(self): |
790 |
|
return "(" + str(self.__min) + ", " + str(self.__max) + ", " + \ |
791 |
|
ClassGroup.__repr__(self) + ")" |
792 |
|
|
793 |
class ClassGroupMap(ClassGroup): |
class ClassGroupMap(ClassGroup): |
794 |
"""Currently, this class is not used.""" |
"""Currently, this class is not used.""" |
795 |
|
|