/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/layer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/layer.py

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

revision 374 by jan, Mon Jan 27 14:20:02 2003 UTC revision 389 by jonathan, Mon Feb 10 15:25:30 2003 UTC
# Line 143  class Layer(BaseLayer): Line 143  class Layer(BaseLayer):
143          self.shapetable = Table(filename)          self.shapetable = Table(filename)
144          self.table = self.shapetable          self.table = self.shapetable
145    
146          self.classification = Classification()          self.classification = Classification(self)
147          self.classification.setNull(          self.classification.SetDefaultStroke(stroke)
148              {'stroke':stroke, 'stroke_width':stroke_width, 'fill':fill})          self.classification.SetDefaultStrokeWidth(stroke_width)
149            self.classification.SetDefaultFill(fill)
150    
151            self.UnsetModified()
152    
153      def open_shapefile(self):      def open_shapefile(self):
154          if self.shapefile is None:          if self.shapefile is None:
# Line 248  class Layer(BaseLayer): Line 251  class Layer(BaseLayer):
251          self.projection = projection          self.projection = projection
252          self.changed(LAYER_PROJECTION_CHANGED, self)          self.changed(LAYER_PROJECTION_CHANGED, self)
253    
     def SetFill(self, fill):  
         """Set the layer's fill color. None means the shapes are not filled"""  
         self.fill = fill  
         self.changed(LAYER_LEGEND_CHANGED, self)  
   
     def SetStroke(self, stroke):  
         """Set the layer's stroke color. None means the shapes are not  
         stroked."""  
         self.stroke = stroke  
         self.changed(LAYER_LEGEND_CHANGED, self)  
   
     def SetStrokeWidth(self, width):  
         """Set the layer's stroke width."""  
         self.stroke_width = width  
         self.changed(LAYER_LEGEND_CHANGED, self)  
   
254      def TreeInfo(self):      def TreeInfo(self):
255          items = []          items = []
256    
# Line 284  class Layer(BaseLayer): Line 271  class Layer(BaseLayer):
271              if color is None:              if color is None:
272                  return "None"                  return "None"
273              return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue)              return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue)
274          items.append(_("Fill: ") + color_string(self.fill))  
275          items.append(_("Outline: ") + color_string(self.stroke))          # layers will always have a classification with at least a NULL data set
276    
277            #items.append((_("Fill: %s") % color_string(self.fill), self.fill))
278            #items.append((_("Outline: %s") % color_string(self.stroke), self.stroke))
279    
280            items.append(self.classification)
281    
282          return (_("Layer '%s'") % self.Title(), items)          return (_("Layer '%s'") % self.Title(), items)
283    

Legend:
Removed from v.374  
changed lines
  Added in v.389

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26