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

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

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

revision 1967 by jpye, Mon Dec 1 07:58:58 2008 UTC revision 1968 by jpye, Mon Dec 1 08:13:10 2008 UTC
# Line 1  Line 1 
1  from gaphas import Canvas  from gaphas import Canvas
2    from gaphas.item import Line
3    
4  class BlockCanvas(Canvas):  class BlockCanvas(Canvas):
5      def update_constraints(self, items):      def update_constraints(self, items):
# Line 65  class BlockCanvas(Canvas): Line 66  class BlockCanvas(Canvas):
66          for item in self.get_all_items():          for item in self.get_all_items():
67              if not hasattr(item, 'blockinstance'):              if not hasattr(item, 'blockinstance'):
68                  continue                  continue
69              bi = item.blockinstance              s += str(item.blockinstance)
             s += "\t%s IS_A %s;\n" % (bi.name, bi.blocktype.type.getName())  
70    
71          for item in self.get_all_items():          for item in self.get_all_items():
72              if not hasattr(item, 'lineinstance'):              if not isinstance(item, Line):
73                  continue                  continue
74              li = item.lineinstance              s += "\t%s, %s ARE_THE_SAME;\n" % (item._handles[0].connected_to.blockinstance.name, item._handles[1].connected_to.blockinstance.name)
             s += ("\t%s, %s ARE_THE_SAME;\n" % (li.fromblock.name, li.toblock.name))  
75          s += "END canvasmodel;\n";          s += "END canvasmodel;\n";
76          return s          return s
77    

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

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