/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/mainwindow.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/mainwindow.py

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

revision 2364 by joey, Fri Oct 1 18:18:49 2004 UTC revision 2529 by russell, Thu Jan 20 17:55:23 2005 UTC
# Line 35  from Thuban.UI.multiplechoicedialog impo Line 35  from Thuban.UI.multiplechoicedialog impo
35  import view  import view
36  import tree  import tree
37  import tableview, identifyview  import tableview, identifyview
 from Thuban.UI.classifier import Classifier  
38  import legend  import legend
39  from menu import Menu  from menu import Menu
40    
# Line 53  import Thuban.Model.resource Line 52  import Thuban.Model.resource
52    
53  import projdialog  import projdialog
54    
55    from Thuban.Lib.classmapper import ClassMapper
56    
57    layer_properties_dialogs = ClassMapper()
58    
59  class MainWindow(DockFrame):  class MainWindow(DockFrame):
60    
# Line 338  class MainWindow(DockFrame): Line 340  class MainWindow(DockFrame):
340              text = "(%10.10g, %10.10g)" % pos              text = "(%10.10g, %10.10g)" % pos
341          else:          else:
342              text = ""              text = ""
343                map = self.canvas.Map()
344                for layer in map.layers:
345                    bbox = layer.LatLongBoundingBox()
346                    if bbox:
347                        left, bottom, right, top = bbox
348                        if not (-180 <= left <= 180 and
349                            -180 <= right <= 180 and
350                            -90 <= top <= 90 and
351                            -90 <= bottom <= 90):
352                            text = ("Select '"+layer.title+"' and pick a " +
353                                "projection using Layer/Projection...")
354                            break
355    
356          self.set_position_text(text)          self.set_position_text(text)
357    
358      def set_position_text(self, text):      def set_position_text(self, text):
# Line 651  class MainWindow(DockFrame): Line 666  class MainWindow(DockFrame):
666                                layer.ShapeStore(),                                layer.ShapeStore(),
667                                projection = layer.GetProjection())                                projection = layer.GetProjection())
668              new_classification = copy.deepcopy(layer.GetClassification())              new_classification = copy.deepcopy(layer.GetClassification())
669                new_layer.SetClassificationColumn(
670                        layer.GetClassificationColumn())
671              new_layer.SetClassification(new_classification)              new_layer.SetClassification(new_classification)
672              self.Map().AddLayer(new_layer)              self.Map().AddLayer(new_layer)
673    
# Line 729  class MainWindow(DockFrame): Line 746  class MainWindow(DockFrame):
746          currently selected layer if one is defined for this layer          currently selected layer if one is defined for this layer
747          type.          type.
748          """          """
749          name = "layer_properties" + str(id(layer))          dialog_class = layer_properties_dialogs.get(layer)
750          self.OpenOrRaiseDialog(name, Classifier, layer, group = group)  
751                    if dialog_class is not None:
752                name = "layer_properties" + str(id(layer))
753                self.OpenOrRaiseDialog(name, dialog_class, layer, group = group)
754    
755      def LayerJoinTable(self):      def LayerJoinTable(self):
756          layer = self.canvas.SelectedLayer()          layer = self.canvas.SelectedLayer()
757          if layer is not None:          if layer is not None:

Legend:
Removed from v.2364  
changed lines
  Added in v.2529

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26