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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1968 by jpye, Mon Dec 1 08:13:10 2008 UTC revision 1969 by jpye, Tue Dec 2 07:40:59 2008 UTC
# Line 1  Line 1 
1    from gaphas.item import Line
 # This class is not yet used, but should be.  
2    
3  class LineInstance:  class LineInstance:
4      """      """
5      Class representation of the ASCEND 'ARE_THE_SAME' relationship      Class representation of the ASCEND 'ARE_THE_SAME' relationship
6      signified by a ConnectorLine on the BlockCanvas.      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):      def __init__(self):
20          self.fromblock = None          self.connectedblocks = []
         self.toblock = None  
21    
22      def __str__(self):      def __str__(self):
23          s += ("\t%s, %s ARE_THE_SAME;\n" % (li.fromblock.name, li.toblock.name))          """
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    

Legend:
Removed from v.1968  
changed lines
  Added in v.1969

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