277 |
items = [] |
items = [] |
278 |
|
|
279 |
def build_color_item(text, color): |
def build_color_item(text, color): |
280 |
if color is Color.None: |
if color is Color.Transparent: |
281 |
return ("%s: %s" % (text, _("None")), None) |
return ("%s: %s" % (text, _("None")), None) |
282 |
|
|
283 |
return ("%s: (%.3f, %.3f, %.3f)" % |
return ("%s: (%.3f, %.3f, %.3f)" % |
373 |
props -- a ClassGroupProperties object. The class is copied if |
props -- a ClassGroupProperties object. The class is copied if |
374 |
prop is not None. Otherwise, a default set of properties |
prop is not None. Otherwise, a default set of properties |
375 |
is created such that: line color = Color.Black, line width = 1, |
is created such that: line color = Color.Black, line width = 1, |
376 |
and fill color = Color.None |
and fill color = Color.Transparent |
377 |
""" |
""" |
378 |
|
|
379 |
self.stroke = None |
self.stroke = None |
385 |
else: |
else: |
386 |
self.SetLineColor(Color.Black) |
self.SetLineColor(Color.Black) |
387 |
self.SetLineWidth(1) |
self.SetLineWidth(1) |
388 |
self.SetFill(Color.None) |
self.SetFill(Color.Transparent) |
389 |
|
|
390 |
def SetProperties(self, props): |
def SetProperties(self, props): |
391 |
"""Set this class's properties to those in class props.""" |
"""Set this class's properties to those in class props.""" |
406 |
""" |
""" |
407 |
|
|
408 |
assert isinstance(color, Color) |
assert isinstance(color, Color) |
409 |
#self.stroke = Color(color.red, color.green, color.blue) |
self.stroke = color |
|
self.stroke = copy.copy(color) |
|
410 |
|
|
411 |
def GetLineWidth(self): |
def GetLineWidth(self): |
412 |
"""Return the line width.""" |
"""Return the line width.""" |
434 |
""" |
""" |
435 |
|
|
436 |
assert isinstance(fill, Color) |
assert isinstance(fill, Color) |
437 |
self.fill = copy.copy(fill) |
self.fill = fill |
|
#self.fill = Color(fill.red, fill.green, fill.blue) |
|
438 |
|
|
439 |
def __eq__(self, other): |
def __eq__(self, other): |
440 |
"""Return true if 'props' has the same attributes as this class""" |
"""Return true if 'props' has the same attributes as this class""" |