/[ascend]/trunk/pygtk/canvas/lineinstance.py
ViewVC logotype

Contents of /trunk/pygtk/canvas/lineinstance.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1969 - (show annotations) (download) (as text)
Tue Dec 2 07:40:59 2008 UTC (13 years, 7 months ago) by jpye
File MIME type: text/x-python
File size: 1024 byte(s)
Commenting, changed context menu tool for deletion (buggy still).
1 from gaphas.item import Line
2
3 class LineInstance:
4 """
5 Class representation of the ASCEND 'ARE_THE_SAME' relationship
6 signified by a ConnectorLine on the BlockCanvas.
7
8 There will be a reference to a LineInstance stored within a
9 LineItem object.
10
11 The intention is that it should be possible to encapsulate all the
12 non-graphical information about a canvas model using a number of
13 BlockInstance and LineInstance objects, and no Gaphas objects. It
14 should be possible to pickle this collection of objects and have everything
15 that is necessary for passing the model to ASCEND -- this provides the
16 clean separation of ASCEND-related and Gaphas-releated code, hopefully.
17 """
18
19 def __init__(self):
20 self.connectedblocks = []
21
22 def __str__(self):
23 """
24 Representation of this line requires the name object from the
25 BlockInstance as well as name associated with the connected Port
26 (still a problem).
27 """
28 try:
29 return ("\t%s, %s ARE_THE_SAME;\n" % (li.fromblock.name, li.toblock.name))
30 except:
31 return ""
32

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22