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

Contents of /branches/WIP-pyshapelib-bramz/Thuban/Model/label.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Tue Aug 28 15:41:52 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/label.py
File MIME type: text/x-python
File size: 1122 byte(s)
import all the source files

1 # Copyright (c) 2001 by Intevation GmbH
2 # Authors:
3 # Bernhard Herzog <[email protected]>
4 #
5 # This program is free software under the GPL (>=v2)
6 # Read the file COPYING coming with Thuban for details.
7
8 __version__ = "$Revision$"
9
10 from messages import CHANGED
11
12 from base import TitledObject, Modifiable
13
14 ALIGN_CENTER = "center"
15 ALIGN_TOP = "top"
16 ALIGN_BOTTOM = "bottom"
17 ALIGN_LEFT = "left"
18 ALIGN_RIGHT = "right"
19 ALIGN_BASELINE = "baseline"
20
21 class Label:
22
23 def __init__(self, x, y, text, halign, valign):
24 self.x = x
25 self.y = y
26 self.text = text
27 self.halign = halign
28 self.valign = valign
29
30
31 class LabelLayer(TitledObject, Modifiable):
32
33 def __init__(self, title):
34 TitledObject.__init__(self, title)
35 Modifiable.__init__(self)
36 self.labels = []
37
38 def Labels(self):
39 return self.labels
40
41 def AddLabel(self, x, y, text, halign = "left", valign="center"):
42 self.labels.append(Label(x, y, text, halign, valign))
43 self.changed(CHANGED)
44
45 def RemoveLabel(self, index):
46 del self.labels[index]
47 self.changed(CHANGED)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26