root/trunk/RBRapier/RBRapier/Formats/Attic/SVG.old/SVGSkin/line.py

Revision 656, 2.2 kB (checked in by sholloway, 5 years ago)

*** empty log message ***

Line 
1 #!/usr/bin/env python
2 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 ##~ License
4 ##~
5 ##- The RuneBlade Foundation library is intended to ease some
6 ##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.)
7 ##- applications, while providing the flexibility to modularly change the
8 ##- architecture. Enjoy.
9 ##~
10 ##~ Copyright (C) 2002  TechGame Networks, LLC.
11 ##~
12 ##~ This library is free software; you can redistribute it and/or
13 ##~ modify it under the terms of the BSD style License as found in the
14 ##~ LICENSE file included with this distribution.
15 ##~
16 ##~ TechGame Networks, LLC can be reached at:
17 ##~ 3578 E. Hartsel Drive #211
18 ##~ Colorado Springs, Colorado, USA, 80920
19 ##~
20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 #~ Imports
24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
26 from SVGSkinObject import SVGSkinObject
27 from RenderItems.Shapes import ShapeRenderItem
28
29 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 #~ Definitions
31 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32
33 class LineRenderItem(ShapeRenderItem):
34     def DisplayOn(self, renderer):
35         renderer.DisplayLine(self)
36
37     def InterpretSettings(self, settings):
38         ShapeRenderItem.InterpretSettings(self, settings)
39         self.SetX1(settings['x1'])
40         self.SetY1(settings['y1'])
41         self.SetX2(settings['x2'])
42         self.SetY2(settings['y2'])
43
44     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
46     def GetX1(self):
47         return self._x1
48     def SetX1(self, value):
49         self._x1 = self._asCoord(value)
50     x1 = property(GetX1, SetX1)
51
52     def GetY1(self):
53         return self._y1
54     def SetY1(self, value):
55         self._y1 = self._asCoord(value)
56     y1 = property(GetY1, SetY1)
57
58     def GetX2(self):
59         return self._x2
60     def SetX2(self, value):
61         self._x2 = self._asCoord(value)
62     x2 = property(GetX2, SetX2)
63
64     def GetY2(self):
65         return self._y2
66     def SetY2(self, value):
67         self._y2 = self._asCoord(value)
68     y2 = property(GetY2, SetY2)
69
70 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
72 class line(SVGSkinObject):
73     RenderItemFactory = LineRenderItem
74
Note: See TracBrowser for help on using the browser.