22 |
|
|
23 |
class Label: |
class Label: |
24 |
|
|
25 |
"""This class repesents a single label that is |
"""This class repesents a single label. |
26 |
defined by its coordinate, the text as well |
|
27 |
|
The label is defined by its coordinate, the text as well |
28 |
as vertical and horizontal alignment concerning |
as vertical and horizontal alignment concerning |
29 |
the coordinate.""" |
the coordinate. |
30 |
|
""" |
31 |
|
|
32 |
def __init__(self, x, y, text, halign, valign): |
def __init__(self, x, y, text, halign, valign): |
33 |
"""Initialize the label with the given parameters.""" |
"""Initialize the label with the given parameters.""" |
43 |
"""This represent a layer holding a number of labels.""" |
"""This represent a layer holding a number of labels.""" |
44 |
|
|
45 |
def __init__(self, title): |
def __init__(self, title): |
46 |
"""Initialize the LabeleLayer with an empty |
"""Initialize the LabeleLayer. |
47 |
|
|
48 |
|
Initialization is done with an empty |
49 |
list of labels and set the title to "title". |
list of labels and set the title to "title". |
50 |
""" |
""" |
51 |
TitledObject.__init__(self, title) |
TitledObject.__init__(self, title) |
82 |
self.changed(CHANGED) |
self.changed(CHANGED) |
83 |
|
|
84 |
def TreeInfo(self): |
def TreeInfo(self): |
85 |
"""Return a tuple of (title, tupel) describing the contents |
"""Return a description of the object. |
86 |
of the object in a tree-structure. |
|
87 |
|
A tuple of (title, tupel) describing the contents |
88 |
|
of the object in a tree-structure is returned. |
89 |
""" |
""" |
90 |
items = [] |
items = [] |
91 |
items.append(_("Number of labels: %d") % len(self.labels)) |
items.append(_("Number of labels: %d") % len(self.labels)) |