239 |
"""Set the layer's stroke width.""" |
"""Set the layer's stroke width.""" |
240 |
self.stroke_width = width |
self.stroke_width = width |
241 |
self.changed(LAYER_LEGEND_CHANGED, self) |
self.changed(LAYER_LEGEND_CHANGED, self) |
242 |
|
|
243 |
|
def TreeInfo(self): |
244 |
|
items = [] |
245 |
|
|
246 |
|
if self.Visible(): |
247 |
|
items.append("Shown") |
248 |
|
else: |
249 |
|
items.append("Hidden") |
250 |
|
items.append("Shapes: %d" % self.NumShapes()) |
251 |
|
|
252 |
|
bbox = self.LatLongBoundingBox() |
253 |
|
if bbox is not None: |
254 |
|
items.append("Extent (lat-lon): (%g, %g, %g, %g)" % bbox) |
255 |
|
else: |
256 |
|
items.append("Extent (lat-lon):") |
257 |
|
items.append("Shapetype: %s" % shapetype_names[self.ShapeType()]) |
258 |
|
|
259 |
|
def color_string(color): |
260 |
|
if color is None: |
261 |
|
return "None" |
262 |
|
return "(%.3f, %.3f, %.3f)" % (color.red, color.green, color.blue) |
263 |
|
items.append("Fill: " + color_string(self.fill)) |
264 |
|
items.append("Outline: " + color_string(self.stroke)) |
265 |
|
|
266 |
|
return ("Layer '%s'" % self.Title(), items) |