root/gaphor/tags/gaphor-0.3.0/gaphor/diagram/relationship.py

Revision 225, 1.6 kB (checked in by arjanmol, 5 years ago)

*** empty log message ***

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 '''
2 Relationship -- Base class for dependencies and associations.
3 '''
4 # vim:sw=4
5
6 import gobject
7 import diacanvas
8 import gaphor.UML as UML
9 from gaphor.diagram import initialize_item
10 from diagramitem import DiagramItem
11 from diagramline import DiagramLine
12
13 class RelationshipItem(DiagramLine, DiagramItem):
14     __gproperties__ = DiagramItem.__gproperties__
15
16     __gsignals__ = DiagramItem.__gsignals__
17    
18     def __init__(self, id=None):
19         DiagramLine.__init__(self)
20         DiagramItem.__init__(self, id)
21
22     def save (self, save_func):
23         DiagramItem.save(self, save_func)
24         DiagramLine.save(self, save_func)
25
26     def load (self, name, value):
27         if name == 'subject':
28             DiagramItem.load(self, name, value)
29         else:
30             DiagramLine.load(self, name, value)
31
32     def postload(self):
33         DiagramItem.postload(self)
34         DiagramLine.postload(self)
35
36 #    def do_set_property (self, pspec, value):
37 #        DiagramItem.do_set_property(self, pspec, value)
38
39 #    def do_get_property(self, pspec):
40 #       return DiagramItem.do_get_property(self, pspec)
41
42     # Ensure we call the right connect functions:
43     connect = DiagramItem.connect
44     disconnect = DiagramItem.disconnect
45     notify = DiagramItem.notify
46
47     # DiaCanvasItem callbacks
48     def on_glue(self, handle, wx, wy):
49         return self._on_glue(handle, wx, wy, diacanvas.CanvasLine)
50
51     def on_connect_handle (self, handle):
52         return self._on_connect_handle(handle, diacanvas.CanvasLine)
53
54     def on_disconnect_handle (self, handle):
55         return self._on_disconnect_handle(handle, diacanvas.CanvasLine)
56
57
58 initialize_item(RelationshipItem)
Note: See TracBrowser for help on using the browser.