/[thuban]/trunk/thuban/Thuban/UI/classifier.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/UI/classifier.py

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

revision 1447 by jonathan, Thu Jul 17 14:59:29 2003 UTC revision 1464 by bh, Fri Jul 18 18:20:40 2003 UTC
# Line 35  from Thuban.Model.layer import Layer, Ra Line 35  from Thuban.Model.layer import Layer, Ra
35  from Thuban.UI.classgen import ClassGenDialog  from Thuban.UI.classgen import ClassGenDialog
36    
37  from dialogs import NonModalNonParentDialog  from dialogs import NonModalNonParentDialog
38    from messages import MAP_REPLACED
39    
40  ID_CLASS_TABLE = 40011  ID_CLASS_TABLE = 40011
41    
# Line 682  class Classifier(NonModalNonParentDialog Line 683  class Classifier(NonModalNonParentDialog
683    
684          self.__SetTitle(layer.Title())          self.__SetTitle(layer.Title())
685    
686            self.parent.Subscribe(MAP_REPLACED, self.map_replaced)
687          self.layer = layer          self.layer = layer
688          self.map = map          self.map = map
689    
# Line 702  class Classifier(NonModalNonParentDialog Line 704  class Classifier(NonModalNonParentDialog
704    
705          if layer.HasClassification():          if layer.HasClassification():
706              self.originalClass = self.layer.GetClassification()              self.originalClass = self.layer.GetClassification()
707              self.originalClassField = self.layer.GetClassificationField()              self.originalClassField = self.layer.GetClassificationColumn()
708              field = self.originalClassField              field = self.originalClassField
709              fieldType = self.layer.GetFieldType(field)              fieldType = self.layer.GetFieldType(field)
710    
# Line 860  class Classifier(NonModalNonParentDialog Line 862  class Classifier(NonModalNonParentDialog
862          self.haveApplied = False          self.haveApplied = False
863    
864      def unsubscribe_messages(self):      def unsubscribe_messages(self):
865            self.parent.Unsubscribe(MAP_REPLACED, self.map_replaced)
866          self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)          self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
867          self.layer.Unsubscribe(LAYER_SHAPESTORE_REPLACED,          self.layer.Unsubscribe(LAYER_SHAPESTORE_REPLACED,
868                                 self.layer_shapestore_replaced)                                 self.layer_shapestore_replaced)
# Line 869  class Classifier(NonModalNonParentDialog Line 872  class Classifier(NonModalNonParentDialog
872              self.Close()              self.Close()
873    
874      def layer_shapestore_replaced(self, *args):      def layer_shapestore_replaced(self, *args):
875            """Subscribed to the map's LAYER_SHAPESTORE_REPLACED message.
876    
877            Close self.
878            """
879            self.Close()
880    
881        def map_replaced(self, *args):
882            """Subscribed to the mainwindow's MAP_REPLACED message. Close self."""
883          self.Close()          self.Close()
884    
885      def EditSymbol(self, row):      def EditSymbol(self, row):
# Line 987  class Classifier(NonModalNonParentDialog Line 998  class Classifier(NonModalNonParentDialog
998              self.classGrid.SaveEditControlValue()              self.classGrid.SaveEditControlValue()
999              clazz, name = self.__BuildClassification(self.__cur_field, True)              clazz, name = self.__BuildClassification(self.__cur_field, True)
1000    
1001              self.layer.SetClassificationField(name)              self.layer.SetClassificationColumn(name)
1002              self.layer.SetClassification(clazz)              self.layer.SetClassification(clazz)
1003    
1004          self.haveApplied = True          self.haveApplied = True
# Line 1011  class Classifier(NonModalNonParentDialog Line 1022  class Classifier(NonModalNonParentDialog
1022      def _OnRevert(self, event):      def _OnRevert(self, event):
1023          """The layer's current classification stays the same."""          """The layer's current classification stays the same."""
1024          if self.haveApplied:          if self.haveApplied:
1025              self.layer.SetClassificationField(self.originalClassField)              self.layer.SetClassificationColumn(self.originalClassField)
1026              self.layer.SetClassification(self.originalClass)              self.layer.SetClassification(self.originalClass)
1027    
1028          #self.Close()          #self.Close()

Legend:
Removed from v.1447  
changed lines
  Added in v.1464

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26