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

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

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

revision 303 by bh, Mon Sep 2 16:47:53 2002 UTC revision 433 by jonathan, Mon Feb 24 18:47:49 2003 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001, 2002 by Intevation GmbH  # Copyright (c) 2001, 2002, 2003 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 30  from Thuban.Model.layer import SHAPETYPE Line 30  from Thuban.Model.layer import SHAPETYPE
30  from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \  from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \
31       ALIGN_LEFT, ALIGN_RIGHT       ALIGN_LEFT, ALIGN_RIGHT
32  from Thuban.Lib.connector import Publisher  from Thuban.Lib.connector import Publisher
33    from Thuban.Model.color import Color
34    
35  from renderer import ScreenRenderer, PrinterRender  from renderer import ScreenRenderer, PrinterRender
36    
# Line 497  class MapCanvas(wxWindow, Publisher): Line 498  class MapCanvas(wxWindow, Publisher):
498          offx, offy = self.offset          offx, offy = self.offset
499          self.set_view_transform(self.scale, (offx + dx, offy + dy))          self.set_view_transform(self.scale, (offx + dx, offy + dy))
500    
501        def SelectTool(self, tool):
502            """Make tool the active tool.
503    
504            The parameter should be an instance of Tool or None to indicate
505            that no tool is active.
506            """
507            self.tool = tool
508    
509      def ZoomInTool(self):      def ZoomInTool(self):
510          """Start the zoom in tool"""          """Start the zoom in tool"""
511          self.tool = ZoomInTool(self)          self.SelectTool(ZoomInTool(self))
512    
513      def ZoomOutTool(self):      def ZoomOutTool(self):
514          """Start the zoom out tool"""          """Start the zoom out tool"""
515          self.tool = ZoomOutTool(self)          self.SelectTool(ZoomOutTool(self))
516    
517      def PanTool(self):      def PanTool(self):
518          """Start the pan tool"""          """Start the pan tool"""
519          self.tool = PanTool(self)          self.SelectTool(PanTool(self))
520    
521      def IdentifyTool(self):      def IdentifyTool(self):
522          """Start the identify tool"""          """Start the identify tool"""
523          self.tool = IdentifyTool(self)          self.SelectTool(IdentifyTool(self))
524    
525      def LabelTool(self):      def LabelTool(self):
526          """Start the label tool"""          """Start the label tool"""
527          self.tool = LabelTool(self)          self.SelectTool(LabelTool(self))
528    
529      def CurrentTool(self):      def CurrentTool(self):
530          """Return the name of the current tool or None if no tool is active"""          """Return the name of the current tool or None if no tool is active"""
# Line 561  class MapCanvas(wxWindow, Publisher): Line 570  class MapCanvas(wxWindow, Publisher):
570          self.set_current_position(event)          self.set_current_position(event)
571          if self.dragging:          if self.dragging:
572              self.ReleaseMouse()              self.ReleaseMouse()
573              self.tool.Hide(self.drag_dc)              try:
574              self.tool.MouseUp(event)                  self.tool.Hide(self.drag_dc)
575              self.drag_dc = None                  self.tool.MouseUp(event)
576          self.dragging = 0              finally:
577                    self.drag_dc = None
578                    self.dragging = 0
579    
580      def OnMotion(self, event):      def OnMotion(self, event):
581          self.set_current_position(event)          self.set_current_position(event)
# Line 696  class MapCanvas(wxWindow, Publisher): Line 707  class MapCanvas(wxWindow, Publisher):
707              if not layer.Visible():              if not layer.Visible():
708                  continue                  continue
709    
710              filled = layer.fill is not None              filled = layer.GetClassification().GetDefaultFill() \
711              stroked = layer.stroke is not None                       is not Color.None
712                stroked = layer.GetClassification().GetDefaultStroke() \
713                          is not Color.None
714    
715              layer_proj = layer.projection              layer_proj = layer.projection
716              if layer_proj is not None:              if layer_proj is not None:

Legend:
Removed from v.303  
changed lines
  Added in v.433

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26