/[thuban]/trunk/thuban/Thuban/Model/layer.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/Model/layer.py

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

revision 6 by bh, Tue Aug 28 15:41:52 2001 UTC revision 82 by bh, Fri Feb 15 17:11:04 2002 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001 by Intevation GmbH  # Copyright (c) 2001, 2002 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4  #  #
# Line 102  class Layer(BaseLayer): Line 102  class Layer(BaseLayer):
102      """      """
103    
104      def __init__(self, title, filename, projection = None,      def __init__(self, title, filename, projection = None,
105                   fill = None, stroke = _black, visible = 1):                   fill = None, stroke = _black, stroke_width = 1, visible = 1):
106          """Initialize the layer.          """Initialize the layer.
107    
108          title -- the title          title -- the title
# Line 121  class Layer(BaseLayer): Line 121  class Layer(BaseLayer):
121          self.projection = projection          self.projection = projection
122          self.fill = fill          self.fill = fill
123          self.stroke = stroke          self.stroke = stroke
124            self.stroke_width = stroke_width
125          self.shapefile = None          self.shapefile = None
126            self.open_shapefile()
127          # shapetable is the table associated with the shapefile, while          # shapetable is the table associated with the shapefile, while
128          # table is the default table used to look up attributes for          # table is the default table used to look up attributes for
129          # display          # display
# Line 173  class Layer(BaseLayer): Line 175  class Layer(BaseLayer):
175              poly = shape.vertices()[0]              poly = shape.vertices()[0]
176              points = []              points = []
177              for x, y in poly:              for x, y in poly:
178                  points.append(x, y)                  points.append((x, y))
179          return Shape(points)          return Shape(points)
180    
181      def SetProjection(self, projection):      def SetProjection(self, projection):
# Line 191  class Layer(BaseLayer): Line 193  class Layer(BaseLayer):
193          stroked."""          stroked."""
194          self.stroke = stroke          self.stroke = stroke
195          self.changed(LAYER_LEGEND_CHANGED, self)          self.changed(LAYER_LEGEND_CHANGED, self)
196    
197        def SetStrokeWidth(self, width):
198            """Set the layer's stroke width."""
199            self.stroke_width = width
200            self.changed(LAYER_LEGEND_CHANGED, self)

Legend:
Removed from v.6  
changed lines
  Added in v.82

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26