/[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 1058 by frank, Tue May 27 11:30:29 2003 UTC revision 1142 by bh, Tue Jun 10 09:41:57 2003 UTC
# Line 20  from wxPython.grid import * Line 20  from wxPython.grid import *
20  from Thuban import _  from Thuban import _
21  from Thuban.UI.common import Color2wxColour, wxColour2Color  from Thuban.UI.common import Color2wxColour, wxColour2Color
22    
23    from Thuban.Model.messages import MAP_LAYERS_REMOVED, LAYER_SHAPESTORE_REPLACED
24  from Thuban.Model.range import Range  from Thuban.Model.range import Range
25  from Thuban.Model.classification import \  from Thuban.Model.classification import \
26      Classification, ClassGroupDefault, \      Classification, ClassGroupDefault, \
# Line 31  from Thuban.Model.color import Color Line 32  from Thuban.Model.color import Color
32  from Thuban.Model.layer import Layer, RasterLayer, \  from Thuban.Model.layer import Layer, RasterLayer, \
33      SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT      SHAPETYPE_ARC, SHAPETYPE_POLYGON, SHAPETYPE_POINT
34    
35  from Thuban.UI.classgen import ClassGenDialog, ClassGenerator  from Thuban.UI.classgen import ClassGenDialog
36    
37  from dialogs import NonModalNonParentDialog  from dialogs import NonModalNonParentDialog
38    
# Line 677  class Classifier(NonModalNonParentDialog Line 678  class Classifier(NonModalNonParentDialog
678                     FIELDTYPE_INT:    _("Integer"),                     FIELDTYPE_INT:    _("Integer"),
679                     FIELDTYPE_DOUBLE: _("Decimal")}                     FIELDTYPE_DOUBLE: _("Decimal")}
680    
681      def __init__(self, parent, name, layer, group = None):      def __init__(self, parent, name, map, layer, group = None):
682          NonModalNonParentDialog.__init__(self, parent, name, "")          NonModalNonParentDialog.__init__(self, parent, name, "")
683    
684          self.__SetTitle(layer.Title())          self.__SetTitle(layer.Title())
685    
686          self.layer = layer          self.layer = layer
687            self.map = map
688    
689            self.map.Subscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
690            self.layer.Subscribe(LAYER_SHAPESTORE_REPLACED,
691                                 self.layer_shapestore_replaced)
692    
693          self.genDlg = None          self.genDlg = None
694    
# Line 853  class Classifier(NonModalNonParentDialog Line 858  class Classifier(NonModalNonParentDialog
858          text_title.SetFocus()          text_title.SetFocus()
859          self.haveApplied = False          self.haveApplied = False
860    
861        def unsubscribe_messages(self):
862            self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed)
863            self.layer.Unsubscribe(LAYER_SHAPESTORE_REPLACED,
864                                   self.layer_shapestore_replaced)
865    
866        def map_layers_removed(self, map):
867            if self.layer not in self.map.Layers():
868                self.unsubscribe_messages()
869                self.Close()
870    
871        def layer_shapestore_replaced(self, *args):
872            self.unsubscribe_messages()
873            self.Close()
874    
875      def EditSymbol(self, row):      def EditSymbol(self, row):
876          table = self.classGrid.GetTable()          table = self.classGrid.GetTable()
877          prop = table.GetValueAsCustom(row, COL_SYMBOL, None)          prop = table.GetValueAsCustom(row, COL_SYMBOL, None)

Legend:
Removed from v.1058  
changed lines
  Added in v.1142

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26